# The "vec_rot_x" Function

### Syntax:

vec_rot_x(x1, y1, x2, y2, [deg]);

Argument |
Type |
Description |

x1 | real | Horizontal center point |

y1 | real | Vertical center point |

x2 | real | Horizontal distance from the rotation center point |

y2 | real | Vertical distance from the rotation center point |

[deg] | real | Optional: Angle of rotation in degrees |

### Description:

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

Supplying an angle 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 trigonometry functions based on the same angle. If no angle is supplied, the previous angle’s sine and cosine will be used instead. This is highly useful for improving performance when calculating multiple points based on the same rotation.

Example:x = vec_rot_x(128, 128, 64, 64, image_angle); y = vec_rot_y(128, 128, 64, 64);