R2::basic_orientation_qty

namespace nin::R2 {
    template <std::floating_point T>
    class basic_orientation_qty;
}

A 2D orientation stored internally as a unit complex number. The default-constructed orientation corresponds to zero rotation (identity).

Orientations represent a direction without tracking the number of full turns performed to reach it. For turn-aware transformations use basic_rotation.

Nested types

Type Definition

value_type

T

Member functions

(Constructor)

constructs a 2D orientation

basic_orientation_qty()

(1)

basic_orientation_qty(basic_orientation_qty<T1> const&)

(2)

basic_orientation_qty(std::complex<Tin> const& cplx)

(3)

basic_orientation_qty(angle const& value)

(4)

  • (1) Default constructor. Identity orientation.

  • (2) Explicit converting constructor from a different floating-point type.

  • (3) Constructs from a complex number. Throws std::domain_error if the absolute value is not normal.

  • (4) Constructs from an angle quantity.

to_complex

returns the underlying complex representation

std::complex<T> const& to_complex() const

(1)

to_angle

converts the orientation to an angle

angle to_angle(angle modulus_centre = 0 rad) const

(1)

Returns the orientation as an angle quantity, wrapped around the given modulus centre (default: 0).