Angles

Introduction

Simplifies the calls to angle-related functions such as angle wrapping, degree-radian conversions, rotation matrix representations.

CompilingLinking

Include the following at the top of any translation unit that uses geometry functions or classes.

  #include <ecl/geometry/angle.hpp>

  using ecl::Angle;
  using ecl::wrap_angle;

You will also need to link to -lecl_geometry.

Usage

Functions

For those who prefer to use function based libraries, the ecl::wrap_angle function can be used to operate on simple float types.

  double angle = wrap_angle(3.33);

For conversions:

  double rads = radians_to_degrees(1.44);
  double degrees = degrees_to_radians(rads);

Classes

The angle class is a convenience class that automates storage and angle wrapping for you. It uses by default, radians (which any good engineer/mathematician should default to!). Take this into consideration if using it where speed is of the essence. That is, don't use Angle and then do all your calculations in degrees - there will be alot of copying!

  Angle<double> a(3.33); // automatically wraps on -pi:pi 
  double degrees = a.degrees();
  Angle<double> b = a + 3.24; // again, will automatically wrap the answer.
  Angle<double>::RotationMatrix matrix = a.rotationMatrix(); // currently using a 2d eigen matrix.

unitTests



ecl_geometry
Author(s): Daniel Stonier
autogenerated on Wed Aug 26 2015 11:27:46