POV-Ray : Newsgroups : povray.advanced-users : subtle behavior of Spline_Trans() macro in transforms.inc Server Time
8 Jul 2024 15:39:39 EDT (-0400)
  subtle behavior of Spline_Trans() macro in transforms.inc (Message 4 to 13 of 33)  
<<< Previous 3 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Warp
Subject: Re: subtle behavior of Spline_Trans() macro in transforms.inc
Date: 20 Apr 2009 01:58:41
Message: <49ec0f11@news.povray.org>
clipka <nomail@nomail> wrote:
> It's fundamentally impossible to do that.

> To compute a tangent to an arbitrary curve defined as f(t) (the value of which
> in this case is a vector), you need the derivative f'(t) of that function,

  I find those two sentences contradictory. First you say that it's
impossible, and immediately after you tell how it's done.

-- 
                                                          - Warp


Post a reply to this message

From: scott
Subject: Re: subtle behavior of Spline_Trans() macro in transforms.inc
Date: 20 Apr 2009 03:26:48
Message: <49ec23b8$1@news.povray.org>
>> To compute a tangent to an arbitrary curve defined as f(t) (the value of 
>> which
>> in this case is a vector), you need the derivative f'(t) of that 
>> function,
>
>  I find those two sentences contradictory. First you say that it's
> impossible, and immediately after you tell how it's done.

Really? Can a macro in POV SDL calculate the exact mathematical derivative 
of a function?  I didn't know that.


Post a reply to this message

From: Warp
Subject: Re: subtle behavior of Spline_Trans() macro in transforms.inc
Date: 20 Apr 2009 04:28:23
Message: <49ec3227@news.povray.org>
scott <sco### [at] scottcom> wrote:
> >> To compute a tangent to an arbitrary curve defined as f(t) (the value of 
> >> which
> >> in this case is a vector), you need the derivative f'(t) of that 
> >> function,
> >
> >  I find those two sentences contradictory. First you say that it's
> > impossible, and immediately after you tell how it's done.

> Really? Can a macro in POV SDL calculate the exact mathematical derivative 
> of a function?  I didn't know that.

  Can a macro calculate points on a spline?

  It's simply a question of creating the macro. I don't see the problem.

  (The only situation where it would really be impossible to get an accurate
direction would be if the spline function does *not* have a derivative at all,
as is the case with some functions in mathematics.)

-- 
                                                          - Warp


Post a reply to this message

From: clipka
Subject: Re: subtle behavior of Spline_Trans() macro in transforms.inc
Date: 20 Apr 2009 04:45:00
Message: <web.49ec3596987a083f1a1b9caf0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> clipka <nomail@nomail> wrote:
> > It's fundamentally impossible to do that.
>
> > To compute a tangent to an arbitrary curve defined as f(t) (the value of which
> > in this case is a vector), you need the derivative f'(t) of that function,
>
>   I find those two sentences contradictory. First you say that it's
> impossible, and immediately after you tell how it's done.

There's no contradiction in those two sentences unless you erroneously assume
"it" to be a forward reference (which is a very uncommon syntax in English
language :P) to "to compute a tangent..." while in fact it is a reference to
getting the macro to work with 0 as a parameter.


Post a reply to this message

From: clipka
Subject: Re: subtle behavior of Spline_Trans() macro in transforms.inc
Date: 20 Apr 2009 05:05:00
Message: <web.49ec3a86987a083f1a1b9caf0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> > Really? Can a macro in POV SDL calculate the exact mathematical derivative
> > of a function?  I didn't know that.
>
>   Can a macro calculate points on a spline?
>
>   It's simply a question of creating the macro. I don't see the problem.

Ah, yes? Then go ahead and present your solution, Mr. Smart... pure POV-Ray SDL,
please.


Post a reply to this message

From: Warp
Subject: Re: subtle behavior of Spline_Trans() macro in transforms.inc
Date: 20 Apr 2009 05:35:15
Message: <49ec41d3@news.povray.org>
clipka <nomail@nomail> wrote:
> Warp <war### [at] tagpovrayorg> wrote:
> > > Really? Can a macro in POV SDL calculate the exact mathematical derivative
> > > of a function?  I didn't know that.
> >
> >   Can a macro calculate points on a spline?
> >
> >   It's simply a question of creating the macro. I don't see the problem.

> Ah, yes? Then go ahead and present your solution, Mr. Smart... pure POV-Ray SDL,
> please.

  I don't have the motivation to study exactly which mathematical function
POV-Ray is using for its splines nor calculating its derivatives.

  I don't see the problem you are having. A derivative function is nothing
more than a function. In the exact same way as you can create a macro which
returns values of a function, you can create another macro which returns
values of its derivative function. Because it's just another function.

  If you tell me that the derivative of the spline function can *not* be
calculated because it's one of those functions without a derivative, then
that may be plausible (although you would have to explain why that is so).
However, you write as if creating a macro which returns a vector based on
a derivative function is impossible. I just can't understand what is the
problem you are seeing there.

  Suppose we had the 1-dimensional function x^2 and we wanted to create a
macro which returns the tangent vector at a given point in that function.
Since we know that the derivative of x^2 is 2*x, that's rather trivial to do:

#macro OriginalFunction(X) X*X #end

#macro DirectionAt(X) <1, 2*X> #end

  It's the same thing for the spline, but a bitmore complicated (because
a spline is a 3-dimensional function rather than a 1-dimensional one and
thus you need the three partial derivatives).

-- 
                                                          - Warp


Post a reply to this message

From: clipka
Subject: Re: subtle behavior of Spline_Trans() macro in transforms.inc
Date: 20 Apr 2009 06:10:00
Message: <web.49ec49b4987a083f1a1b9caf0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
>   I don't have the motivation to study exactly which mathematical function
> POV-Ray is using for its splines nor calculating its derivatives.

You do have the motivation throwing smart statements about, but you don't have
any motivation to really investigate the issues you are talking about.

Wise guy.

You don't have to calculate any particular spline's derivative to find out what
the problem is. You just have to look at the macros and SDL statements we're
discussing about, to find out that you're overlooking a much more serious
obstacle.


>   I don't see the problem you are having. A derivative function is nothing
> more than a function. In the exact same way as you can create a macro which
> returns values of a function, you can create another macro which returns
> values of its derivative function. Because it's just another function.

BTW, *I* am not having *any* problem. I'm just describing why a problem the OP
has is inevitable.

Anyway, we are talking about macros. SDL statements, you know?

So how do you get the function value of an arbitrary spline out of POV-Ray?

Rrrright - you use an interface built into the SDL, which lets you use the
spline as a function.

Fine. Now how do you get the derivative value of an arbitrary spline out of
POV-Ray?

Um... yes?

Mind you: The spline type and coefficients are buried in the bowels of POV-Ray.
If you want to get at them from SDL, you need an interface to do that. No
interface - no access to the data. No access to the data - no way to insert the
data into your derivative formula (let alone decide on which formula to use,
because we don't even know the type of the spline).


Now, your turn. Stop blurping and show what you *really* know and understand
about the OP's question.

And no excuses: If you're too lazy to really investigate a certain matter,
better hold your breath about it right from the start.


Post a reply to this message

From: Warp
Subject: Re: subtle behavior of Spline_Trans() macro in transforms.inc
Date: 20 Apr 2009 07:03:30
Message: <49ec5682@news.povray.org>
clipka <nomail@nomail> wrote:
> Warp <war### [at] tagpovrayorg> wrote:
> >   I don't have the motivation to study exactly which mathematical function
> > POV-Ray is using for its splines nor calculating its derivatives.

> You do have the motivation throwing smart statements about, but you don't have
> any motivation to really investigate the issues you are talking about.

> Wise guy.

  Then you, as a wiser person than me, could explain to me why it would be
impossible to calculate the tangent of a spline using its derivative
functions. I'm so stupid that I can't understand why it's impossible.

> You don't have to calculate any particular spline's derivative to find out what
> the problem is. You just have to look at the macros and SDL statements we're
> discussing about, to find out that you're overlooking a much more serious
> obstacle.

  What obstacle?

  The question was: Is it possible to calculate the tangent of a spline with
absolute accuracy? The answer is obviously: Yes, it's possible.

  What does the macro you are talking about have anything to do with this?

> >   I don't see the problem you are having. A derivative function is nothing
> > more than a function. In the exact same way as you can create a macro which
> > returns values of a function, you can create another macro which returns
> > values of its derivative function. Because it's just another function.

> BTW, *I* am not having *any* problem. I'm just describing why a problem the OP
> has is inevitable.

  The original poster asked if it's possible to calculate the direction of
the spline with complete accuracy. You said that it's impossible. That's
clearly not true.

> Anyway, we are talking about macros. SDL statements, you know?

  So what? What is it in SDL that prevents you from evaluating a function?

> So how do you get the function value of an arbitrary spline out of POV-Ray?

  Splines are not "arbitrary". They have a well-defined formula.

> Rrrright - you use an interface built into the SDL, which lets you use the
> spline as a function.

> Fine. Now how do you get the derivative value of an arbitrary spline out of
> POV-Ray?

  Maybe you should go back to school to learn how to calculate derivatives
because you clearly don't seem to grasp the concept.

> Mind you: The spline type and coefficients are buried in the bowels of POV-Ray.

  So what? Does that mean you cannot calculate its derivative? It's not
like POV-Ray would be proprietary closed source.

> If you want to get at them from SDL, you need an interface to do that.

  Why can't you just write the functions in SDL? Is there something in
there that cannot be done in SDL?

> No
> interface - no access to the data. No access to the data - no way to insert the
> data into your derivative formula (let alone decide on which formula to use,
> because we don't even know the type of the spline).

  You are seriously claiming that it's impossible to write a spline function
in SDL? Maybe you should check eg. Colefax's spline includes.

  There's no basic difference between Colefax's spline includes and the
internal splines used in povray, except maybe for some coefficients.

> Now, your turn. Stop blurping and show what you *really* know and understand
> about the OP's question.

> And no excuses: If you're too lazy to really investigate a certain matter,
> better hold your breath about it right from the start.

  You have failed completely to explain the problem. You have just rambled
about how something is impossible in SDL without giving any actual example.

-- 
                                                          - Warp


Post a reply to this message

From: clipka
Subject: Re: subtle behavior of Spline_Trans() macro in transforms.inc
Date: 20 Apr 2009 08:45:00
Message: <web.49ec6da2987a083f1a1b9caf0@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
>   What obstacle?
>
>   The question was: Is it possible to calculate the tangent of a spline with
> absolute accuracy? The answer is obviously: Yes, it's possible.
>
>   What does the macro you are talking about have anything to do with this?

....

>   The original poster asked if it's possible to calculate the direction of
> the spline with complete accuracy. You said that it's impossible. That's
> clearly not true.

*Sigh*

RTFOP, man. If you did, then please do so again.

The OP was all about "fixing" that *macro*.

I told him it is fundamentally impossible to "fix", and explained why that is
so.


>   So what? What is it in SDL that prevents you from evaluating a function?
....
>   Maybe you should go back to school to learn how to calculate derivatives
> because you clearly don't seem to grasp the concept.

This is getting ridiculous. Read my posts. Again if you like. Until you have
grasped it.

Or leave it if you're too lazy or stoned or whatever.

I'll try just once more again:


Calculus is not the problem. Getting the type of function and parameters out of
POV-Ray and into SDL is.

There *IS* an interface to get f[P](x) out of POV-Ray into SDL, where f is the
spline function and P are the parameters (i.e. control points).

There is *NOT* an interface to get an exact f'[P](x) out of POV-Ray into SDL. (I
don't believe the f' are even coded into POV-Ray.)

There is *NOT* an interface to get the generic formula for f out of POV-Ray into
SDL (i.e. you don't know if f is a linear spline, cubic spline, akima spline or
what-have-you).

There is *NOT* an interface to get the actual values of P out of POV-Ray.

=> There is *NOT* an interface to get anything out of POV-Ray to compute f'[P],
hence there is *NOT* a way to compute an exact value of f'[P](x).


>   You have failed completely to explain the problem. You have just rambled
> about how something is impossible in SDL without giving any actual example.

In case you don't realize, knowing that a feat is fundamentally impossible *is*
a valuable contribution to a problem, because it makes clear that it's not
worth trying.

All you contributed doesn't help the OP in any way. All your claiming that there
*is* a way without showing *how* is only suited to potentially confuse.

So, tell us, how can the macro be fixed - or please STFU.


'Nuff said, or I'll get real personal. Get out of that "I know better" mode
you're currently in, Warp.


Post a reply to this message

From: Warp
Subject: Re: subtle behavior of Spline_Trans() macro in transforms.inc
Date: 20 Apr 2009 09:37:42
Message: <49ec7aa5@news.povray.org>
clipka <nomail@nomail> wrote:
> The OP was all about "fixing" that *macro*.

> I told him it is fundamentally impossible to "fix", and explained why that is
> so.

  Why would it be impossible to fix? Just change it to calculate the
direction from the derivative functions.

  Very laborious and impractical to change the macro to do so (for dubious
benefit)? Yes. Impossible? Definitely not.

> Calculus is not the problem. Getting the type of function and parameters out of
> POV-Ray and into SDL is.

  Requires a bit of digging the povray source code, resolving the partial
derivatives of the spline function, and implementing these derivatives in SDL.
Laborious? Yes. Impossible? No.

> There *IS* an interface to get f[P](x) out of POV-Ray into SDL, where f is the
> spline function and P are the parameters (i.e. control points).

> There is *NOT* an interface to get an exact f'[P](x) out of POV-Ray into SDL. (I
> don't believe the f' are even coded into POV-Ray.)

  So what? Just implement that "interface" in SDL. Write the derivative
functions in SDL.

> There is *NOT* an interface to get the generic formula for f out of POV-Ray into
> SDL (i.e. you don't know if f is a linear spline, cubic spline, akima spline or
> what-have-you).

  The macro can be told by the user what type of spline it is.
Practical? No. Impossible? No.

> There is *NOT* an interface to get the actual values of P out of POV-Ray.

> => There is *NOT* an interface to get anything out of POV-Ray to compute f'[P],
> hence there is *NOT* a way to compute an exact value of f'[P](x).

  There is no interface to know how the random number generator used by
POV-Ray is implemented. Does that mean it's *impossible* to replicate the
random number generator in SDL? Of course not.

  Imagine a variant problem: Someone wants to know what is the current
32-bit seed in a RNG stream. There's no interface in SDL to retrieve this
value. Does this mean it's *impossible* in SDL to calculate this value?

  No, it's not impossible.

> >   You have failed completely to explain the problem. You have just rambled
> > about how something is impossible in SDL without giving any actual example.

> In case you don't realize, knowing that a feat is fundamentally impossible *is*
> a valuable contribution to a problem, because it makes clear that it's not
> worth trying.

  Lying is not the correct answer.

  The correct answer is: While it may be theoretically possible to make
the macro calculate the exact result, it's not worth the effort (because
the result will not be significantly, if at all, more accurate than the
current approximation method).

> All you contributed doesn't help the OP in any way. All your claiming that there
> *is* a way without showing *how* is only suited to potentially confuse.

> So, tell us, how can the macro be fixed - or please STFU.

  And exactly what did you contribute? You claimed that it's *impossible*,
which is simply not true.

  Just because something is difficult and impractical and has little value
is not the same thing as *impossible*.

> 'Nuff said, or I'll get real personal. Get out of that "I know better" mode
> you're currently in, Warp.

  Maybe you should look into the mirror sometime?

-- 
                                                          - Warp


Post a reply to this message

<<< Previous 3 Messages Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.