×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Are you an
Engineering professional?
Join Eng-Tips Forums!
• Talk With Other Members
• Be Notified Of Responses
• Keyword Search
Favorite Forums
• Automated Signatures
• Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

#### Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

# Get unitVector X Y Z values

## Get unitVector X Y Z values

(OP)
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

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

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

### RE: Get unitVector X Y Z values

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

### RE: Get unitVector X Y Z values

(OP)
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

Thanks

### RE: Get unitVector X Y Z values

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

#### Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

#### Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

#### Resources

Low-Volume Rapid Injection Molding With 3D Printed Molds
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a partâ€™s function at the center of their design considerations. Download Now
Taking Control of Engineering Documents
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now

Close Box

# Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

• Talk To Other Members
• Notification Of Responses To Questions
• Favorite Forums One Click Access
• Keyword Search Of All Posts, And More...

Register now while it's still free!