Vehicle Simulation – Coordinate Systems & Transformations

Overview

There are several types of coordinate systems used in mathematics, physics, and engineering. Here are some of the most common types:

  • Cartesian Coordinate System: This is the most commonly used coordinate system. It is a 2D or 3D system that uses perpendicular lines to represent the x, y, and z-axes. The point where these axes intersect is called the origin.
  • Polar Coordinate System: This system is used to represent points in a 2D space using a radial distance and an angle. The point is defined by its distance from the origin and the angle between the positive x-axis and the line connecting the origin to the point.
  • Cylindrical Coordinate System: This is an extension of the polar coordinate system to 3D space. In this system, a point is represented using a radial distance, an angle, and a height.
  • Spherical Coordinate System: This system is used to represent points in 3D space using a radial distance, an azimuth angle, and an elevation angle. It is often used in physics to describe the motion of objects in space.
  • Homogeneous Coordinate System: This system is used in computer graphics and computer vision to represent points in 2D or 3D space using a 4D vector. This allows for efficient matrix operations and transformations.

Transformations

To rotate coordinates in 3 dimensions, you need to use a rotation matrix. A rotation matrix is a 3×3 matrix that describes a rotation around a specific axis (Wikipedia).
Here are some simplified steps to rotate coordinates in 3 dimensions:

  1. Define the rotation angle and axis: Determine the angle of rotation and the axis around which you want to rotate the coordinates. The axis can be any vector in 3D space.
  2. Construct the rotation matrix: Use the rotation angle and axis to construct the rotation matrix. There are different ways to construct a rotation matrix depending on the type of rotation you want to perform.
  3. Apply the rotation matrix: To rotate a point (x,y,z) using the rotation matrix R, you need to multiply the point by the rotation matrix.
  4. Repeat for all points: If you have multiple points that need to be rotated, apply the rotation matrix to each point separately.

Note that if you want to rotate around a different axis, you will need to construct a different rotation matrix. Also, if you want to perform multiple rotations, you can apply the rotation matrices in sequence.

Reading:
https://www.brainm.com/software/pubs/math/Rotation_matrix.pdf
http://kth.diva-portal.org/smash/get/diva2:917943/FULLTEXT01.pdf

Also see: https://simulatevehicles.com/theory/vehicle-dynamics/