|
-
Apr 18th, 2001, 04:43 AM
#1
Thread Starter
Addicted Member
I have two locations, X1/Y1/Z1, and X2/Y2/Z2. How do I go from the first point to the second in an imcrement of 0.5? Do I have to do it somehow using vectors?
-Git
-
Apr 18th, 2001, 04:50 AM
#2
transcendental analytic
yes, you have V1 and V2 position vectors, and want V3 of length 0.5 parallell to V2-V1
V3 is then 0.5*(V2-V1) / |V2-V1|
differences of components for vector difference and multiply components with factor for vector product.
|V*| is the magnitude of a vector and is evaluated with
sqr(X*X+Y*Y+Z*Z)
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|