Re: A92: Re: Basic -- 3Dstudio


[Prev][Next][Index][Thread]

Re: A92: Re: Basic -- 3Dstudio




>do you have the BASIC code handy? i'd like to look at it.


Define A (alpha), B (beta), G (gamma).  All angles.

Define P1 as vector <x,y,z> and P2 as vector <x,y>.

P2 = < P1.x * cos(A) + P1.y * cos(B) + P1.z * cos(G),
       P1.x * sin(A) + P1.y * sin(B) + P1.z * sin(G) >

P2 is now the orthographic projection of P1 with the
X, Y, and Z axes at angles A, B, and G (respectively)
on the unit circle.

Voila.

Define ortho(a,b,g,p)=when(
   {p[1]*cos(a)+p[2]*cos(b)+p[3]*cos(g)
    p[1]*sin(a)+p[2]*sin(b)+p[3]*sin(g)}
(DO NOT BREAK LINES!! ENTER ON SINGLE LINE ONLY!!)

Usage:
ortho(-5º,90º,-165º,{1,2,3})          {-1.902   1.136}
ortho(30º,90º,150º,{0,4,2})[1]                  -1.732
ortho(30º,90º,150º,{2,2,0})[2]                   3.000

====
Aaron Hill (Redmond, WA)
E-Mail: SeracOhw24@msn.com
IRC-Nick: Serac (EF-Net) (was SeracOhw)