sdfHelpers Module

Collection of helper functions for SDFs:

This module defines transforms that can be applied to each SDF:

  • Rotate_{x,y,z}
  • Translate
  • RotationAlign (not tested)
  • RotMat (not tested)
  • Identity
  • SkewSymm


Functions

public function identity() result(r)

Returns the identity transformation matrix

Arguments

None

Return Value real(kind=wp), (4,4)

public function rotate_x(angle) result(r)

rotation in the x-axis function from here

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: angle

Angle to rotate by

Return Value real(kind=wp), (4,4)

public function rotate_y(angle) result(r)

rotation in the y-axis function from here

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: angle

Angle to rotate by

Return Value real(kind=wp), (4,4)

public function rotate_z(angle) result(r)

rotation in the z-axis function from here

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: angle

Angle to rotate by

Return Value real(kind=wp), (4,4)

public function rotationAlign(a, b) result(res)

Calculate the rotation matrix to rotate vector a onto b ref1 ref2

Arguments

Type IntentOptional Attributes Name
type(vector), intent(in) :: a

Vector to rotate. Unit vector

type(vector), intent(in) :: b

Vector to be rotated onto. Unit vector

Return Value real(kind=wp), (4,4)

public function rotmat(axis, angle)

Rotate around around an axis by a given angle taken from here

Arguments

Type IntentOptional Attributes Name
type(vector), intent(in) :: axis

Axis to rotate around

real(kind=wp), intent(in) :: angle

Angle to rotate by in degrees

Return Value real(kind=wp), (4,4)

public function skewSymm(a) result(out)

Calculate the Skew Symmetric matrix for a given vector

Arguments

Type IntentOptional Attributes Name
type(vector), intent(in) :: a

Vector to calculate the skew symmetric matrix for.

Return Value real(kind=wp), (4,4)

public function translate(o) result(out)

Returns the Translation matrix for a given vector translation.

Arguments

Type IntentOptional Attributes Name
type(vector), intent(in) :: o

Vector to translate by.

Return Value real(kind=wp), (4,4)