Plane Equation
I''ve been learning 3d math from tutorials on the internet, and have seen the plane equation expressed as ax + by +cz - d = 0
Isn''t this the same as saying ax + by + cz = d?
Forgive me if I''m missing something, but why the extra operation before the comparison?
______________________________________________There are only 10 types of people in the world: Those who understand binary, and those who don't.
June 02, 2003 01:34 PM
no reason.
If you''re worried about it, it makes no speed difference.
If you''re worried about it, it makes no speed difference.
Because the numbers used are floating-point.
Floating-point always has an approximation error, so a plane in the computer world is defined by abs( ax + by + cz - d ) < epsilon, because there can be no such thing as a float being perfectly equal to zero (it is usually equal to 0.0000000001 or something similar, which returns false if compared to zero).
Since it is easier to compare the abs of a value to epsilon, rather than d - epsilon < ax +by +cz < d + epsilon, they use the extra substraction. This also makes (usually) code clearer.
ToohrVyk
Floating-point always has an approximation error, so a plane in the computer world is defined by abs( ax + by + cz - d ) < epsilon, because there can be no such thing as a float being perfectly equal to zero (it is usually equal to 0.0000000001 or something similar, which returns false if compared to zero).
Since it is easier to compare the abs of a value to epsilon, rather than d - epsilon < ax +by +cz < d + epsilon, they use the extra substraction. This also makes (usually) code clearer.
ToohrVyk

ax + by + cz + d = 0 and ax + by + cz = d are equivalent (except for the change in value of d).
The first is generally preferred for two reasons. The first is simpler because it consists of one set of numbers ( < a,b,c,d > ) compared to the second, which has two ( < a,b,c > and < d > ). The first has " = 0" which always makes life easier for mathematicians.
Now, other than those reasons, ax + by + cz + d = 0 and ax + by + cz = d are equivalent (except for the change in value of d).
Edit: changed "- d" to "+ d" because that is the proper form.
[edited by - Jambolo on June 2, 2003 12:29:34 AM]
The first is generally preferred for two reasons. The first is simpler because it consists of one set of numbers ( < a,b,c,d > ) compared to the second, which has two ( < a,b,c > and < d > ). The first has " = 0" which always makes life easier for mathematicians.
Now, other than those reasons, ax + by + cz + d = 0 and ax + by + cz = d are equivalent (except for the change in value of d).
Edit: changed "- d" to "+ d" because that is the proper form.
[edited by - Jambolo on June 2, 2003 12:29:34 AM]
John BoltonLocomotive Games (THQ)Current Project: Destroy All Humans (Wii). IN STORES NOW!
In school-math it''s just the form for calculating the distance beetwen a point and a plane, just kind of using a formula with a special name and it''s better to imagine that if d = 0 the distance = 0 between point,plane.
The advantages for programming ToohrVyk already told you.
The advantages for programming ToohrVyk already told you.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement