bladex.profilebase.ProfileBase.rotate

ProfileBase.rotate(rad_angle=None, deg_angle=None)[source]

2D counter clockwise rotation about the origin of the Cartesian coordinate system.

The rotation matrix, R(\theta), is used to perform rotation in the 2D Euclidean space about the origin, which is – by default – the leading edge.

R(\theta) is defined by:

\left(\begin{matrix} cos (\theta) & - sin (\theta) \\
sin (\theta) & cos (\theta) \end{matrix}\right)

Given the coordinates of point P such that

P = \left(\begin{matrix} x \\
y \end{matrix}\right),

Then, the rotated coordinates will be:

P^{'} = \left(\begin{matrix} x^{'} \\
         y^{'} \end{matrix}\right)
      = R (\theta) \cdot P

If a standard right-handed Cartesian coordinate system is used, with the X-axis to the right and the Y-axis up, the rotation R (\theta) is counterclockwise. If a left-handed Cartesian coordinate system is used, with X-axis directed to the right and Y-axis directed down, R (\theta) is clockwise.

Parameters:
  • rad_angle (float) – angle in radians. Default value is None
  • deg_angle (float) – angle in degrees. Default value is None
Raises:

ValueError – if both rad_angle and deg_angle are inserted, or if neither is inserted