isquaternion

RTSX Help: test functions on quaternion

isquaternion

isqequal

Test whether a variable is a quaternion, or whether two quaternions are equal.

Syntax

  • h = isquaternion(q )
  • h = isqequal(q1,q2)

Input Arguments

  • q, q1, q2 — a quaternion s <v1,v2,v3>

Output Arguments

  • h — boolean logic (true or false)

Description

isquaternion(q) returns true if q is a quaternion, false otherwise. isqequal(q1, q2) returns true if q1 and q2 are quaternions and q1 == q2, false otherwise. Both functions accept arrays of quaternions and return an array of the same size, whose elements are boolean logic corresponding to whether the test conditions are met.

Examples

-->T1 = troty(pi/4);
 -->q1 = quaternion(T1);
 -->isquaternion(q1)
 ans  =
  T  
 -->R = roty(pi/4);
 -->q2 = quaternion(R);
 -->isqequal(q1,q2)
 ans  =
  T

See also