Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get unitVector X Y Z values

Status
Not open for further replies.

NaWin55

Mechanical
Mar 21, 2020
97
Hi all
i want to create lines on a surface using bunch of points, those lines must be in 5deg incremental
here are the steps
Step:1 - first i will create lines using normal to surface option
Step:2 - then i measure the angle between normaltosurface line and xyPlane if the angle is near to 5deg mutiples number for ex if angle is 81.23deg
Step:3 - then i should create a line using point-direction option which is 80deg and if angle more than 82.5 and less than 87.5 then i should create a line using point-direction option which is 85deg
i need to get the X Y Z direction components which makes the angle between point-direction line and xyplane 5deg multiples like 80,85,90,95,100deg
lines_er7p3f.jpg

the surface in the image is not actual surface

x y z components are unit vectors of line that i need to create
i know the angle, for that angle i need to find out the X Y Z unit vector values using VECTOR ROTATION IN 3D SPACE FORMULA
here is the image of that formula
vector_rotation_z3n2br.jpg

here we know the value of theta using that we need to calculate X Y Z unit vector values
i need to this in VBA
thanks
 
Replies continue below

Recommended for you

just a suggestion: while you learn to use transformation matrix math, you can still use basic geometry logic...

so you have a point A on surface, a Line L, and the angle Theta with Z direction.
This angle is in the plane P defined by L and the vertical line V passing by A.
create the vertical line V and the plane P using vba

the rotation angle Theta could be measured between L and V. the rotation axis would be a line R normal to P passing by A
create this line R in vba

using the reference line V, the line axis R, and angle Theta, you can create the line L2 you want using line angle (ref plane is P and angle is Theta2...)
Create this line L2 in vba

use VBA to measure the line and get its direction, that will give you the XYZ value of the vector of the line you're looking for.

now you can build the line in vba with the point A and the direction you have.

Eric N.
indocti discant et ament meminisse periti
 
hey @itsmyjob thank you for your response, but

i am not getting the following statement

This angle is in the plane P defined by L and the vertical line V passing by A.
create the vertical line V and the plane P using vba


what is vertical line V here and plane P

could you elaborate please

Thanks
 
for 2 given lines the angle between the line are in the plane passing by the 2 lines

you measuring your normal line L and the vertical Z.... Z is a direction not a line so I say you create line passing by point (A) on surface with vertical direction (line v)
the point (A) is the point on the surface where the normal line start from
the plane (P) pass by your normal line (L) and a vertical line (V) from point (A) on surface

Eric N.
indocti discant et ament meminisse periti
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor