R3::basic_translation

namespace nin::R3 {
    template <std::floating_point T>
    struct basic_translation;
}

A 3D displacement that can be applied to a basic_position_qty to produce a new position. The three public fields are unicode delta components.

basic_translation satisfies the container interface with a fixed size() of 3.

Data members

Member Type

Δx

units::length_v<T>

Δy

units::length_v<T>

Δz

units::length_v<T>

Nested types

Type Definition

arithmetic_type

T

unit_type

units::length_v<T>

value_type

unit_type

reference

unit_type&

const_reference

unit_type const&

size_type

std::size_t

difference_type

std::ptrdiff_t

iterator

forward iterator over components

const_iterator

const forward iterator over components

Member functions

(Constructor)

constructs a 3D translation

basic_translation(unit_type Δx = {}, unit_type Δy = {}, unit_type Δz = {})

(1)

Default-constructs all displacements to zero.

invert

negates the displacement in place

void invert()

(1)

operator()

applies the translation to a position

basic_position_qty<T> operator()(basic_position_qty<T> const& p) const

(1)

Returns a new position offset by the displacement.

operator[]

indexed access to displacement components

reference operator[](size_type i)

(1)

const_reference operator[](size_type i) const

(2)

Index 0 returns Δx, index 1 returns Δy, index 2 returns Δz.

begin, end, cbegin, cend

iterators

iterator begin()

(1)

const_iterator begin() const

(2)

const_iterator cbegin() const

(3)

iterator end()

(4)

const_iterator end() const

(5)

const_iterator cend() const

(6)

size, max_size, empty

container capacity

static size_type size()

(1)

static size_type max_size()

(2)

static bool empty()

(3)

  • (1)-(2) Returns 3.

  • (3) Returns false.

Non-member functions

inv

returns an inverted translation

basic_translation<T> inv(basic_translation<T> t)

(1)

compose

composes two translations

basic_translation<T> compose(basic_translation<T> const& lhs, basic_translation<T> const& rhs)

(1)

Returns a translation whose displacement is the sum of the two inputs.