POV-Ray : Newsgroups : povray.advanced-users : Calculating slope of a line : Re: Calculating slope of a line Server Time
1 Jul 2024 04:42:53 EDT (-0400)
  Re: Calculating slope of a line  
From: Le Forgeron
Date: 13 Mar 2010 17:00:19
Message: <4b9c0af3$1@news.povray.org>
Le 13/03/2010 22:05, Kene nous fit lire :
> I am working on a math problem with POV-Ray where I am trying to calculate the
> slope of a line. I have located two points on the line with the coordinates
> (9000, -8022) and (-5000, -1792). Let us assume the first set of coordinates are
> identified as Ref1_Pos.x, Ref1_Pos.z while the second set are Ref2_Pos.x and
> Ref2_Pos.z. The slope formula will be:
> 
> Slope = ( Ref1_Pos.z - Ref2_Pos.z )/( Ref1_Pos.x - Ref2_Pos.x )
> 
> In manual calculation the above problem gives the result: -0.304862
> With POV-Ray I get: -0

Maybe we can see actual code ?

#declare Ref1_Pos=<9000,-8022>;

For instance, you get a .x and a .y (and .z=0)


Post a reply to this message

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