Results 1 to 6 of 6
Thread: Java3D Vector3d.angle(Vector3d)
- 01-20-2009, 02:12 PM #1
Member
- Join Date
- Jan 2009
- Posts
- 3
- Rep Power
- 0
Java3D Vector3d.angle(Vector3d)
Hello Folks
I am new here and i hope you can help me. Here my question:
andJava Code:_v3dA = new Vector3d(1, [B]0[/B], 0); _v3dB = new Vector3d(1, [B]1[/B], 0); double angleZ = _v3dA.angle(_v3dB);
is always 45 Degrees without a prefix. How can I know in which direction the angle is? Or do i misunderstand something?Java Code:_v3dA = new Vector3d(1, [B]1[/B], 0); _v3dB = new Vector3d(1, [B]0[/B], 0); double angleZ = _v3dA.angle(_v3dB);
Thanks for hints,
Duesentrieb
-
what do you mean "without a prefix"? angles don't have direction, they just have value. In other words, an angle is a scalar value.
Last edited by Fubarable; 01-20-2009 at 02:52 PM.
- 01-20-2009, 06:27 PM #3
Member
- Join Date
- Jan 2009
- Posts
- 3
- Rep Power
- 0
So how can I know the angle is for example 90 degrees and nor 270 degrees?
-
You don't. If you go to the API for Vector3D#angle(...), it tells you that the return value is constrained to be between 0 and PI (180 degrees). Thus it will never return 270 degrees.
And this makes sense because in 3 dimensions there really is little difference between 90 and 270 degrees.
- 01-20-2009, 07:45 PM #5
Member
- Join Date
- Jan 2009
- Posts
- 3
- Rep Power
- 0
Yes thank you. The result is between 0 and pi.
So how can I do this for example:
I have 2 different (a+b) line in a 3d room. now i wanna translate line a parallel to line b. How can I do this?
-
Similar Threads
-
Calculate X and Y given starting angle and distance
By nidhirastogi in forum Java 2DReplies: 5Last Post: 08-18-2008, 10:24 PM -
Java3D
By gowry in forum Advanced JavaReplies: 0Last Post: 04-21-2008, 08:07 AM -
Rotations and traslations in java3d
By elberral in forum AWT / SwingReplies: 0Last Post: 04-15-2008, 03:38 PM -
Java3D: Clicking and getting coordinates?
By seabhcan in forum Advanced JavaReplies: 0Last Post: 01-11-2008, 02:46 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks