S
S
s2sk2018-03-26 02:43:16
Geometry
s2sk, 2018-03-26 02:43:16

Rotate square points?

Let's say there is a square. Now its rotation angle is 0. One of its points at angle 0 is at the coordinate (-0.5; 0.0; 0.5). Now let's say I want to rotate it by 45.0 degrees along R(otation)Y (Y height)
Here is the initial position (top view):
gtpAryW.png
And these are the coordinates ? I need to find it based on an angle of 45.
b3KG6uJ.png
Well, can I please use the formula for turning along RX, RZ (as I understand it, you need to play with sin cos tan somehow). Thanks everyone.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2018-03-26
@s2sk

Instead of Y - substitute Z and get what you need.
Rotation around the center:
X = x * cos(alpha) - y * sin(alpha);
Y = x * sin(alpha) + y * cos(alpha);
General formula:
X = (x - x0) * cos(alpha) - (y - y0) * sin(alpha) + x0;
Y = (x - x0) * sin(alpha) + (y - y0) * cos(alpha) + y0;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question