L2C/coordinate_conversion.h
2024-09-22 20:23:56 -06:00

32 lines
1.2 KiB
C

#ifndef COORDINATE_CONVERSION_H
#define COORDINATE_CONVERSION_H
/**
* @brief Converts passed polar coordinates to their cartesian equivalent, using
* pass-by-pointer
*
* @param RADIUS The radius of the polar coordinates
* @param ANGLE The angle of the polar coordinates
* @param pXCoordinate A pointer referencing the variable to place the x
* component of the cartesian coordinates into
* @param pYCoordinate A pointer referencing the variable to place the y
* component of the cartesian coordinates into
*/
void polar_to_cartesian(const double RADIUS, const double ANGLE,
double* pXCoordinate, double* pYCoordinate);
/**
* @brief Converts passed cartesian coordinates to their polar equivalent, using
* pass-by-pointer
*
* @param X_COORDINATE The x component of the cartesian coordinates
* @param Y_COORDINATE The y component of the cartesian coordinates
* @param pRadius A pointer referencing the variable to put the radius of the
* polar coordinates into
* @param pAngle A pointer referencing the variable to put the angle of the
* polar coordinates into
*/
void cartesian_to_polar(const double X_COORDINATE, const double Y_COORDINATE,
double* pRadius, double* pAngle);
#endif // COORDINATE_CONVERSION_H