Ask a Question related to Macromedia Director 3D, Design and Development.
-
JamieCrow #1
Anyone mathematical?
Are you any good at maths? If so I was wondering if you can come up with a nice
formular that I can program in Lingo that will calculate the angle between two
vector points. This would be used to rotate a wall that is positioned at one
vector point (and always pointing upwards from it) so that it rotates to point
towards a new vector point.
Two such points could be (0,0,0) to (15,0,20)
The y cordinate will always be the same within the two vectors.
I think the answer is in this web page somewhere?
[url]http://www.netcomuk.co.uk/~jenolive/vect6.html[/url]
Any thoughts, Thanks.
JamieCrow Guest
-
editing mathematical formula
I like to write and edit mathematical formula some flash texts. I tried to use mathtype: it generates a .gif file, it is not very smart. Has... -
Mathematical differences?!
Hello all, I ported a algorithm from JavaScript to PHP and noticed that PHP outputs a different result than JS. For example: ... -
[PHP] Mathematical differences?!
How could that be?! 1:1 the same code but different outputs? Is this a PHP-bug? :-? *feelin' kinda' smart arsed today, if no one noticed* ... -
[PHP] Help with Mod mathematical function
http://us4.php.net/math The operator you want is % Eg: 5%3 = 2 <desa15@necso.es> wrote in message... -
Help with Mod mathematical function
Hi, I am porting a vb application across to php but have come up against a small problem. The code uses the Mod calculation however I cannot find... -
Andrew Morton #2
Re: Anyone mathematical?
Have you seen angleBetween in the 3D Lingo Dictionary?
Andrew
Andrew Morton Guest
-
JamieCrow #3
Re: Anyone mathematical?
Thanks for that, although it produced odd results. I used pointAt in the end.
George
JamieCrow Guest
-
veganMalcontent #4
Re: Anyone mathematical?
If the two vectors are of unit length, then their dot product is the cosine of
the angle between them. Thus you can normalize them, then take the arccos of
their dot product as the angle between them. I think I did this with the code
below, though I believe I'm not actually using it anymore, so you should check
for correct output, particularly on boundary cases. Note that (0, 0, 0) is a
zero-length vector, so there is no angle between it and any other vector. Also
note that the units here are radians.
on arccos(z)
theta = arcsin(z)
theta = pi / 2.0 - theta
if z * theta < 0.0 then
theta = -1 * theta
end if
return theta
end arccos
on arcsin(z)
if(z >= 1) then
return pi / 2.0
end if
if(z <= -1) then
return - pi / 2.0
end if
return(atan(z / sqrt(1.0 - (z * z))))
end arcsin
veganMalcontent Guest



Reply With Quote

