- #1
arpace
- 9
- 0
So I have a Hermite curve with the control points:
//point# (x,y):
p0 (1,0)
p1 (1,(Math.sqrt(2)-1))
p2 (Math.sqrt(0.5), Math.sqrt(0.5))
I also have the algorithm to find the points on the locus between 0 and 45 degrees:
//L0 is the point on the line between p0 and p1
//L1 is the point on the line between p1 and p2
//Loc is the point on the locus
//...
//keep in mind that although this can be extended with if statements to check for
//any degree with a little modification
//right now, the rule is 0 <= degree <= 45
L0 = p0 + (p1 - p0)*degree/45;
L1 = p1 + (p2 - p1)*degree/45;
Loc = L0 + (L1-L0)*degree/45;
so Shouldn't this, as it is essentially a quadratic Bezier (Hermite) curve representing degrees 0 through 45 of a unit circle , not equal the results of sind(degree) as long as:
0<= degree <= 45 ?
when I use for the degree 22.5, on my windows calculator
sind(22.5) = 0.3826834323650897717284599840304;
...but mine (again using the window calc) at 22.5 degrees is
Loc.y = 0.38388347648318440550105545263106
could this be due to floating point error? Is there something obvious I am missing?
here is an image I made to help with conceptualization
[PLAIN]http://sphotos.ak.fbcdn.net/hphotos-ak-snc4/hs1384.snc4/163638_10100121877154282_28122817_59279302_5323393_n.jpg
//point# (x,y):
p0 (1,0)
p1 (1,(Math.sqrt(2)-1))
p2 (Math.sqrt(0.5), Math.sqrt(0.5))
I also have the algorithm to find the points on the locus between 0 and 45 degrees:
//L0 is the point on the line between p0 and p1
//L1 is the point on the line between p1 and p2
//Loc is the point on the locus
//...
//keep in mind that although this can be extended with if statements to check for
//any degree with a little modification
//right now, the rule is 0 <= degree <= 45
L0 = p0 + (p1 - p0)*degree/45;
L1 = p1 + (p2 - p1)*degree/45;
Loc = L0 + (L1-L0)*degree/45;
so Shouldn't this, as it is essentially a quadratic Bezier (Hermite) curve representing degrees 0 through 45 of a unit circle , not equal the results of sind(degree) as long as:
0<= degree <= 45 ?
when I use for the degree 22.5, on my windows calculator
sind(22.5) = 0.3826834323650897717284599840304;
...but mine (again using the window calc) at 22.5 degrees is
Loc.y = 0.38388347648318440550105545263106
could this be due to floating point error? Is there something obvious I am missing?
here is an image I made to help with conceptualization
[PLAIN]http://sphotos.ak.fbcdn.net/hphotos-ak-snc4/hs1384.snc4/163638_10100121877154282_28122817_59279302_5323393_n.jpg
Last edited by a moderator: