→ index of namespace default
 
→ index of project tkmath
 
→ index of module tkmath

Class tkmath.Quaternionf


Synopsis: This class represents a single precision quaternion of the form a+ib+jc+kd.

  Base classes:
  Methods:

Method add
add quaternion v to this instance
Signature
add(Quaternionfv)
Arguments
Quaternionfv–quaternion value to add

 
→ top of page
Method conjMul
Multiply this conjugated instance with quaternion v (Grassmann product)
Signature
conjMul(Quaternionfv)
Arguments
Quaternionfv–quaternion value to multiply

 
→ top of page
Method dot
Calculate dot product (inner product) of this instance and quaternion v
Signature
dot(Quaternionfv)
 :float
Arguments
Quaternionfv–quaternion value to multiply
Returns
float–dot product of quaternions

 
→ top of page
Method getAbs
Return the absolute value of this instance
Signature
getAbs():float
Returns
float–length of quaternion

 
→ top of page
Method getAbsSqr
Return the squared length of this instance
Signature
getAbsSqr():float
Returns
float–length2 of this instance

 
→ top of page
Method getAngle
Calculate quaternion angle
Signature
getAngle():float
Returns
float–quaternion angle

 
→ top of page
Method getI
Get imaginery i value
Signature
getI():float
Returns
float–imaginery i value

 
→ top of page
Method getJ
Get imaginery j value
Signature
getJ():float
Returns
float–imaginery j value

 
→ top of page
Method getK
Get imaginery k value
Signature
getK():float
Returns
float–
Description
qreturn imaginery k value

 
→ top of page
Method getMatrix4f
Get 4x4 matrix representation of quaternion
Signature
getMatrix4f():Matrix4f
Returns
Matrix4f–matrix representation of quaternion

 
→ top of page
Method getPureUnit
Returns pure unit quaternion from instance
Signature
getPureUnit():Quaternionf
Returns
Quaternionf–pure unit quaternion

 
→ top of page
Method getR
Get Real value
Signature
getR():float
Returns
float–real value

 
→ top of page
Method getRadius
Calculate quaternion radius (_getAbs)
Signature
getRadius():float
Returns
float–length of quaternion

 
→ top of page
Method getRotateMatrix4f
Get 4x4 rotation matrix representation of quaternion q*conj q
Signature
getRotateMatrix4f():Matrix4f
Returns
Matrix4f–rotation matrix representation of quaternion

 
→ top of page
Method getString
Get string representation of quaternion number (a+ib+jc+kd)
Signature
getString():String
Returns
String–string representation (a+ib+jc+kd)

 
→ top of page
Method getV
Get vector value
Signature
getV():Vector3f
Returns
Vector3f–vector part

 
→ top of page
Method init
Init quaternion to a+ib+jc+kd
Signature
init(floata,
  floatb,
  floatc,
  floatd 
  )  
Arguments
floata–new real value
floatb–new i value
floatc–new j value
floatd–new k value

 
→ top of page
Method invert
Calculate the reciprocal value 1/q
Signature
invert()

 
→ top of page
Method mul
Multiply this instance with quaternion v (Grassmann product)
Signature
mul(Quaternionfv)
Arguments
Quaternionfv–quaternion value to multiply

 
→ top of page
Method mulConj
Multiply this instance with conjugated quaternion v (Grassmann product)
Signature
mulConj(Quaternionfv)
Arguments
Quaternionfv–conjugated quaternion value to multiply

 
→ top of page
Method mulf
Multiply this instance with scalar v
Signature
mulf(floatv)
Arguments
floatv–scalar value to multiply

 
→ top of page
Method New
Init quaternion to a+ib+jc+kd and return new instance
Signature
New(floata,
  floatb,
  floatc,
  floatd 
  )  
 :Quaternionf
Arguments
floata–new real value
floatb–new i value
floatc–new j value
floatd–new k value
Returns

 
→ top of page
Method outer
Calculate the outer product of this instance and quaternion v
Signature
Arguments
Quaternionfv–quaternion value to multiply
Returns
Quaternionf–outer product of quaternions

 
→ top of page
Method setAngle
Set new quaternion angle
Signature
setAngle(floata)
Arguments
floata–new angle

 
→ top of page
Method setI
Set imaginery i part to a
Signature
setI(floata)
Arguments
floata–new value for imaginery i value

 
→ top of page
Method setJ
Set imaginery j part to a
Signature
setJ(floata)
Arguments
floata–new value for imaginery j value

 
→ top of page
Method setK
Set imagnery k part to a
Signature
setK(floata)
Arguments
floata–new value for imaginery k value

 
→ top of page
Method setPureUnit
Set new pure unit vector of quaternion
Signature
setPureUnit(Quaternionfv)
Arguments
Quaternionfv–pure unit quaternion with real part zero and length 1

 
→ top of page
Method setR
Set real part to a
Signature
setR(floata)
Arguments
floata–new value for real value

 
→ top of page
Method setRadius
Set new quaternion radius
Signature
setRadius(floata)
Arguments
floata–new length

 
→ top of page
Method setV
Set vector part to v
Signature
setV(Vector3fv)
Arguments
Vector3fv–new value for vector part

 
→ top of page
Method sub
substract quaternion v from this instance
Signature
sub(Quaternionfv)
Arguments
Quaternionfv–quaternion value to substract

 
→ top of page
Method unit
Set length of quaternion to 1
Signature
unit()

 
→ top of page
Method unitScale
Set length of quaternion to s
Signature
unitScale(floats)
Arguments
floats–new length

 
→ top of page
 

Project Modules:tkmath 
Project Classes:Complexd , Complexf , Math , Matrix , Matrix2d , Matrix2f , Matrix2x3f , Matrix3d , Matrix3f , Matrix4d , Matrix4f , Quaterniond , Quaternionf , Vector2d , Vector2f , Vector3d , Vector3f , Vector4d , Vector4f 
Project Functions:absd , absf , acoscd , acoscf , acosd , acosf , acoshcd , acoshcf , acoshd , acoshf , asincd , asincf , asind , asinf , asinhcd , asinhcf , asinhd , asinhf , atan2d , atan2f , atancd , atancf , atand , atanf , atanhcd , atanhcf , atanhd , atanhf , ceild , ceilf , complexd , complexf , complexfPolar , complexfPolar , coscd , coscf , cosd , cosf , coshcd , coshcf , coshd , coshf , exp10d , exp10f , exp2d , exp2f , expcd , expcf , expd , expf , f16_from_f32 , f32_from_f16 , floord , floorf , fx16_from_f16 , hypotd , hypotf , log10d , log10f , log2d , log2f , logcd , logcf , logd , logf , matrix2d , matrix2f , matrix2x3f , matrix3d , matrix3f , matrix4d , matrix4f , modd , modf , powcd , powcf , powd , powf , quaterniond , quaternionf , relCmpd , relCmpf , relErrCmpd , relErrCmpf , roundd , roundf , sincd , sincf , sind , sinf , sinhcd , sinhcf , sinhd , sinhf , sqrtcd , sqrtcf , sqrtd , sqrtf , tancf , tancf , tand , tanf , tanhcd , tanhcf , tanhd , tanhf , vector2d , vector2f , vector3d , vector3f , vector4d , vector4f 
All Namespaces:default , graph , ui 
All Projects:core , eqxmms , ShaderVG , ShaderVG_Text , tkanalogrytm , tkchipmunk , tkclap , tkfileutils , tkfreeglut , tkfreetype2 , tkfreeverb , tkmath , tkmidi , tkmidipipe , tkminnie , tkoldmath , tkopengl , tkportaudio , tkradiastools , tksamplechain , tksampleedit , tksampler , tksdl , tksdl_net , tksidplay2 , tkspeexdsp , tksqlite , tktriangulate , tkui , tkvst2 , tkzip , ui , yingtest 


auto-generated by "DOG", the TkScript document generator. Tue, 3/Mar/2026 18:10:18