POV-Ray : Newsgroups : povray.advanced-users : Calculating slope of a line : Calculating slope of a line Server Time
1 Jul 2024 04:49:02 EDT (-0400)
  Calculating slope of a line  
From: Kene
Date: 13 Mar 2010 16:10:01
Message: <web.4b9bfe2cc9c651bf772dd76f0@news.povray.org>
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

I know I am doing something wrong but I cannot figure it out. Please help.


Post a reply to this message

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