quaternion_mod Module

module~~quaternion_mod~~UsesGraph module~quaternion_mod quaternion_mod module~kinds_mod kinds_mod module~kinds_mod->module~quaternion_mod module~tensor_mod tensor_mod module~kinds_mod->module~tensor_mod module~tensor_mod->module~quaternion_mod
Help

Module for working with quaternions

Used By

module~~quaternion_mod~~UsedByGraph module~quaternion_mod quaternion_mod program~testquaternion_prg testQuaternion_prg module~quaternion_mod->program~testquaternion_prg
Help


Interfaces

public interface quat_t

  • private function newQuat(r, v) result(self)

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in) :: r
    real(kind=wp), intent(in), dimension(3):: v

    Return Value type(quat_t)

public interface norm2

  • private elemental function norm2_q(q) result(o)

    Return the magnitude of the quaternion

    Arguments

    Type IntentOptional AttributesName
    type(quat_t), intent(in) :: q

    The quaternion of interest

    Return Value real(kind=wp)

public interface conjg

  • private elemental function conjg_q(q) result(o)

    Return the conjugate of the quaternion

    Arguments

    Type IntentOptional AttributesName
    type(quat_t), intent(in) :: q

    The quaternion of interest

    Return Value type(quat_t)

public interface exp

  • private elemental function exp_q(q) result(o)

    Take the exponent of a quaternion

    Arguments

    Type IntentOptional AttributesName
    type(quat_t), intent(in) :: q

    The quaternion of interest

    Return Value type(quat_t)

public interface log

  • private elemental function log_q(q) result(o)

    Take the natural log of a quaternion

    Arguments

    Type IntentOptional AttributesName
    type(quat_t), intent(in) :: q

    The quaternion of interest

    Return Value type(quat_t)

public interface log10

  • private elemental function log10_q(q) result(o)

    Take the log10 of a quaternion

    Arguments

    Type IntentOptional AttributesName
    type(quat_t), intent(in) :: q

    The quaternion of interest

    Return Value type(quat_t)

public interface operator(+)

  • private elemental function add_rq(r, q) result(o)

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in) :: r
    type(quat_t), intent(in) :: q

    Return Value type(quat_t)

  • private elemental function add_qr(q, r) result(o)

    Arguments

    Type IntentOptional AttributesName
    type(quat_t), intent(in) :: q
    real(kind=wp), intent(in) :: r

    Return Value type(quat_t)

  • private pure function add_vq(v, q) result(o)

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in), dimension(3):: v
    type(quat_t), intent(in) :: q

    Return Value type(quat_t)

  • private pure function add_qv(q, v) result(o)

    Arguments

    Type IntentOptional AttributesName
    type(quat_t), intent(in) :: q
    real(kind=wp), intent(in), dimension(3):: v

    Return Value type(quat_t)

  • private elemental function add_qq(u, v) result(o)

    Arguments

    Type IntentOptional AttributesName
    type(quat_t), intent(in) :: u
    type(quat_t), intent(in) :: v

    Return Value type(quat_t)

public interface operator(-)

  • private elemental function sub_rq(r, q) result(o)

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in) :: r
    type(quat_t), intent(in) :: q

    Return Value type(quat_t)

  • private elemental function sub_qr(q, r) result(o)

    Arguments

    Type IntentOptional AttributesName
    type(quat_t), intent(in) :: q
    real(kind=wp), intent(in) :: r

    Return Value type(quat_t)

  • private pure function sub_vq(v, q) result(o)

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in), dimension(3):: v
    type(quat_t), intent(in) :: q

    Return Value type(quat_t)

  • private pure function sub_qv(q, v) result(o)

    Arguments

    Type IntentOptional AttributesName
    type(quat_t), intent(in) :: q
    real(kind=wp), intent(in), dimension(3):: v

    Return Value type(quat_t)

  • private elemental function sub_qq(u, v) result(o)

    Arguments

    Type IntentOptional AttributesName
    type(quat_t), intent(in) :: u
    type(quat_t), intent(in) :: v

    Return Value type(quat_t)

public interface operator(*)

  • private elemental function mul_rq(u, v) result(o)

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in) :: u
    type(quat_t), intent(in) :: v

    Return Value type(quat_t)

  • private elemental function mul_qr(u, v) result(o)

    Arguments

    Type IntentOptional AttributesName
    type(quat_t), intent(in) :: u
    real(kind=wp), intent(in) :: v

    Return Value type(quat_t)

  • private pure function mul_vq(u, v) result(o)

    Arguments

    Type IntentOptional AttributesName
    real(kind=wp), intent(in), dimension(3):: u
    type(quat_t), intent(in) :: v

    Return Value type(quat_t)

  • private pure function mul_qv(u, v) result(o)

    Arguments

    Type IntentOptional AttributesName
    type(quat_t), intent(in) :: u
    real(kind=wp), intent(in), dimension(3):: v

    Return Value type(quat_t)

  • private elemental function mul_qq(u, v) result(o)

    Arguments

    Type IntentOptional AttributesName
    type(quat_t), intent(in) :: u
    type(quat_t), intent(in) :: v

    Return Value type(quat_t)

public interface operator(/)

  • private elemental function div_qr(q, r) result(o)

    Arguments

    Type IntentOptional AttributesName
    type(quat_t), intent(in) :: q
    real(kind=wp), intent(in) :: r

    Return Value type(quat_t)


Derived Types

type, public :: quat_t

Hamilton's quaternion extension to complex numbers

Components

TypeVisibility AttributesNameInitial
real(kind=wp), public :: s =0.0_wp

Scalar part

real(kind=wp), public, dimension(3):: v =0.0_wp

Vector part

Constructor

private function newQuat(r, v)

Type-Bound Procedures

procedure, public :: getRotationMatrix

Functions

public elemental function scaler(q) result(o)

Return the scalar part of the quaternion

Arguments

Type IntentOptional AttributesName
type(quat_t), intent(in) :: q

The quaternion of interest

Return Value real(kind=wp)

public function vector(q) result(o)

Return the vector part of the quaternion

Arguments

Type IntentOptional AttributesName
type(quat_t), intent(in) :: q

The quaternion of interest

Return Value real(kind=wp), dimension(3)

public elemental function inv(q) result(o)

Return the inverse of the quaternion

Arguments

Type IntentOptional AttributesName
type(quat_t), intent(in) :: q

The quaternion of interest

Return Value type(quat_t)