Skip to main content

The "rot_point_y" Function

Syntax#

rot_point_y(x, y, [deg]);
ArgumentTypeDescription
xrealThe horizontal distance from the rotation center point
yrealThe vertical distance from the rotation center point
[deg]realOptional: The angle to calculate sine and cosine, in degrees

Description#

Returns the Y component of a point the given distance away rotated by the given angle in degrees. (Center point is assumed as 0.)

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.

Example#

x = 128 + rot_point_x(64, 64, image_angle);
y = 128 + rot_point_y(64, 64);