hexagon logo

Pierce point using variables

I just wanted to check the coordinates of a pierce point between a line and a plane (some issues in another thread), so I calculated it with assignments !

ASSIGN/V1=PL1.IJK
ASSIGN/V2=PL1.XYZ
ASSIGN/V3=LN1.XYZ
ASSIGN/V4=LN1.IJK
ASSIGN/V5=LN1.XYZ-PL1.XYZ
ASSIGN/V6=DOT(V5,V1)
ASSIGN/V7=CROSS(V1,CROSS(V4,V1))
ASSIGN/V8=SIN(DEG2RAD(90-ANGLEBETWEEN(V1,V4)))
ASSIGN/V9=V2+V5-V6*V1-DOT((V6/V8)*V4,V7)*V7



Some more explanations...
CROSS(V4,V1) is perpendicular to V1 and V4 (it's a definition of the cross product)
So CROSS(V1,CROSS(V4,V1)) is perpendicular to V1 and a vector perp to V1 and V4 : it's the projection of V4 on PL1 !
V6/V8 gives the distance D between LN1.XYZ and the pierce point (D * sin (alpha) = V6 <=> D=V6/sin(alpha) )
(V6/V8)*V4 gives the vector between LN1.XYZ and the pierce point.
The dot product DOT((V6/V8)*V4,V7) gives the projection of this vector on V7.
V9 gives the coordinates of the pierce point !

OP=OA+AB+BC+CP
With
OA= vector between origin and PL1.XYZ
AB= vector between PL1.XYZ and LN1.XYZ
BC= vector between LN1.XYZ and its projection on PL1
CP= vector between projected point and pierce point

As usual, it's not really usefull, but it was funny to calculate Slight smile

Happy week-end, all, it's friday (afternoon here !)