Skip to main content

The "rot_vec_y" Function


rot_vec_y(x1, y1, x2, y2, [deg]);
x1realThe horizontal center point
y1realThe vertical center point
x2realThe horizontal distance from the rotation center point
y2realThe vertical distance from the rotation center point
[deg]realOptional: The angle to calculate sine and cosine, in degrees


Returns the Y component of a point the given distance away from the given center point and rotated by the given angle in degrees. (Or in other words, the Y component of the tip of a rotated line.)

Supplying a rotation is optional. As calculating the sine and cosine of angles is costly to performance, these values are stored in memory for use with further instances of angle functions based on the same rotation. If no rotation is supplied, the previous angle's sine and cosine will be used. This is highly useful for improving performance when calculating multiple points based on the same rotation.


x = rot_vec_x(128, 128, 64, 64, image_angle);
y = rot_vec_y(128, 128, 64, 64);