0.9.8: Angle and Trigonometry Functions

| 0.9.8

- Main Page
- Modules
- Files

Functions
Angle and Trigonometry Functions
GLM Core

## Functions
template<typename T , precision P, template< typename, precision > class vecType>
GLM_FUNC_DECL vecType< T, P > | acos (vecType< T, P > const &x)
template<typename T , precision P, template< typename, precision > class vecType>
GLM_FUNC_DECL vecType< T, P > | acosh (vecType< T, P > const &x)
template<typename T , precision P, template< typename, precision > class vecType>
GLM_FUNC_DECL vecType< T, P > | asin (vecType< T, P > const &x)
template<typename T , precision P, template< typename, precision > class vecType>
GLM_FUNC_DECL vecType< T, P > | asinh (vecType< T, P > const &x)
template<typename T , precision P, template< typename, precision > class vecType>
GLM_FUNC_DECL vecType< T, P > | atan (vecType< T, P > const &y, vecType< T, P > const &x)
template<typename T , precision P, template< typename, precision > class vecType>
GLM_FUNC_DECL vecType< T, P > | atan (vecType< T, P > const &y_over_x)
template<typename T , precision P, template< typename, precision > class vecType>
GLM_FUNC_DECL vecType< T, P > | atanh (vecType< T, P > const &x)
template<typename T , precision P, template< typename, precision > class vecType>
GLM_FUNC_DECL vecType< T, P > | cos (vecType< T, P > const &angle)
template<typename T , precision P, template< typename, precision > class vecType>
GLM_FUNC_DECL vecType< T, P > | cosh (vecType< T, P > const &angle)
template<typename T , precision P, template< typename, precision > class vecType>
GLM_FUNC_DECL GLM_CONSTEXPR vecType< T, P > | degrees (vecType< T, P > const &radians)
template<typename T , precision P, template< typename, precision > class vecType>
GLM_FUNC_DECL GLM_CONSTEXPR vecType< T, P > | radians (vecType< T, P > const &degrees)
template<typename T , precision P, template< typename, precision > class vecType>
GLM_FUNC_DECL vecType< T, P > | sin (vecType< T, P > const &angle)
template<typename T , precision P, template< typename, precision > class vecType>
GLM_FUNC_DECL vecType< T, P > | sinh (vecType< T, P > const &angle)
template<typename T , precision P, template< typename, precision > class vecType>
GLM_FUNC_DECL vecType< T, P > | tan (vecType< T, P > const &angle)
template<typename T , precision P, template< typename, precision > class vecType>
GLM_FUNC_DECL vecType< T, P > | tanh (vecType< T, P > const &angle)

## Detailed Description

Function parameters specified as angle are assumed to be in units of radians.

In no case will any of these functions result in a divide by zero error. If the divisor of a ratio is 0, then results will be undefined.

These all operate component-wise. The description is per component.

## Function Documentation

GLM_FUNC_DECL vecType<T, P> glm::acos | ( | vecType< T, P > const & | x | ) |

Arc cosine.

Returns an angle whose sine is x. The range of values returned by this function is [0, PI]. Results are undefined if |x| > 1.

Template Parameters

  genType | Floating-point scalar or vector types.

See also
  GLSL acos man page
  GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions

GLM_FUNC_DECL vecType<T, P> glm::acosh | ( | vecType< T, P > const & | x | ) |

Arc hyperbolic cosine; returns the non-negative inverse of cosh.

Results are undefined if x < 1.

Template Parameters

  genType | Floating-point scalar or vector types.

See also
  GLSL acosh man page
  GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions

GLM_FUNC_DECL vecType<T, P> glm::asin | ( | vecType< T, P > const & | x | ) |

Arc sine.

Returns an angle whose sine is x. The range of values returned by this function is [-PI/2, PI/2]. Results are undefined if |x| > 1.

Template Parameters

  genType | Floating-point scalar or vector types.

See also
  GLSL asin man page
  GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions

GLM_FUNC_DECL vecType<T, P> glm::asinh | ( | vecType< T, P > const & | x | ) |

Arc hyperbolic sine; returns the inverse of sinh.

Template Parameters

  genType | Floating-point scalar or vector types.

See also
  GLSL asinh man page
  GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions

GLM_FUNC_DECL vecType<T, P> glm::atan | ( | vecType< T, P > const & | y,
|  | vecType< T, P > const & | x
| ) |  |

Arc tangent.

Returns an angle whose tangent is y/x. The signs of x and y are used to determine what quadrant the angle is in. The range of values returned by this function is [-PI, PI]. Results are undefined if x and y are both 0.

Template Parameters

  genType | Floating-point scalar or vector types.

See also
  GLSL atan man page
  GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions

Referenced by glm::atan2().

GLM_FUNC_DECL vecType<T, P> glm::atan | ( | vecType< T, P > const & | y_over_x | ) |

Arc tangent.

Returns an angle whose tangent is y_over_x. The range of values returned by this function is [-PI/2, PI/2].

Template Parameters

  genType | Floating-point scalar or vector types.

See also
  GLSL atan man page
  GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions

GLM_FUNC_DECL vecType<T, P> glm::atanh | ( | vecType< T, P > const & | x | ) |

Arc hyperbolic tangent; returns the inverse of tanh.

Results are undefined if abs(x) >= 1.

Template Parameters

  genType | Floating-point scalar or vector types.

See also
  GLSL atanh man page
  GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions

GLM_FUNC_DECL vecType<T, P> glm::cos | ( | vecType< T, P > const & | angle | ) |

The standard trigonometric cosine function.

The values returned by this function will range from [-1, 1].

Template Parameters

  genType | Floating-point scalar or vector types.

See also
  GLSL cos man page
  GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions

GLM_FUNC_DECL vecType<T, P> glm::cosh | ( | vecType< T, P > const & | angle | ) |

Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2.

Template Parameters

  genType | Floating-point scalar or vector types.

See also
  GLSL cosh man page
  GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions

GLM_FUNC_DECL GLM_CONSTEXPR vecType<T, P> glm::degrees | ( | vecType< T, P > const & | radians | ) |

Converts radians to degrees and returns the result.

Template Parameters

  genType | Floating-point scalar or vector types.

See also
  GLSL degrees man page
  GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions

GLM_FUNC_DECL GLM_CONSTEXPR vecType<T, P> glm::radians | ( | vecType< T, P > const & | degrees | ) |

Converts degrees to radians and returns the result.

Template Parameters

  genType | Floating-point scalar or vector types.

See also
  GLSL radians man page
  GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions

GLM_FUNC_DECL vecType<T, P> glm::sin | ( | vecType< T, P > const & | angle | ) |

The standard trigonometric sine function.

The values returned by this function will range from [-1, 1].

Template Parameters

  genType | Floating-point scalar or vector types.

See also
  GLSL sin man page
  GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions

GLM_FUNC_DECL vecType<T, P> glm::sinh | ( | vecType< T, P > const & | angle | ) |

Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2.

Template Parameters

  genType | Floating-point scalar or vector types.

See also
  GLSL sinh man page
  GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions

GLM_FUNC_DECL vecType<T, P> glm::tan | ( | vecType< T, P > const & | angle | ) |

The standard trigonometric tangent function.

Template Parameters

  genType | Floating-point scalar or vector types.

See also
  GLSL tan man page
  GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions

GLM_FUNC_DECL vecType<T, P> glm::tanh | ( | vecType< T, P > const & | angle | ) |

Returns the hyperbolic tangent function, sinh(angle) / cosh(angle)

Template Parameters

  genType | Floating-point scalar or vector types.

See also
  GLSL tanh man page
  GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions