position_of Function

private function position_of(self, other) result(p)

The origin of other (a frame of the same tree) in this frame's coordinates, from both frames' transforms to the root (through their first parents).

Type Bound

ReferenceFrame

Arguments

Type IntentOptional Attributes Name
class(ReferenceFrame), intent(in) :: self

(other: a frame of the same tree)

class(ReferenceFrame), intent(in) :: other

(other: a frame of the same tree)

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


Calls

proc~~position_of~~CallsGraph proc~position_of ReferenceFrame%position_of proc~rigid_inverse rigid_inverse proc~position_of->proc~rigid_inverse proc~world_matrix ReferenceFrame%world_matrix proc~position_of->proc~world_matrix proc~world_matrix->proc~world_matrix proc~local_matrix ReferenceFrame%local_matrix proc~world_matrix->proc~local_matrix proc~frame_matrix frame_matrix proc~local_matrix->proc~frame_matrix proc~quat_to_matrix quat_to_matrix proc~frame_matrix->proc~quat_to_matrix

Source Code

    function position_of(self, other) result(p)
        class(ReferenceFrame), intent(in) :: self, other    !! (other: a frame of the same tree)
        real(wp) :: p(3)
        real(wp) :: m(4,4)
        m = matmul(rigid_inverse(self%world_matrix()), other%world_matrix())
        p = m(1:3, 4)
    end function position_of