home
 
 index of namespace default
 
 index of project tkmath
 
 index of module tkmath

Class tkmath.Vector4f


SynopsisThis class represents a single precision 4 dimensional euclidean space vector.

  Base classes:
  Methods:
Method add
Add another vector v to this instance
Signature
add(Vector4fv)
Arguments
Vector4fvvector to add

 
 top of page
Method dot
Calculate dot product from this instance and v
Signature
dot(Vector4fv)
 :float
Arguments
Vector4fvVector4f instance
Returns
floatscalar value

 
 top of page
Method getAbs
Return length of vector
Signature
getAbs():float
Returns
floatlength of vector

 
 top of page
Method getAbsSqr
Return squared length of vector
Signature
getAbsSqr():float
Returns
floatlength2 of vector

 
 top of page
Method getString
Get string representation of vector (x, y, z, w)
Signature
getString():String
Returns
Stringstring representation of vector

 
 top of page
Method getW
Get value of w element
Signature
getW():float
Returns
floatvalue of w element

 
 top of page
Method getX
Get value of x element
Signature
getX():float
Returns
floatvalue of x element

 
 top of page
Method getY
Get value of y element
Signature
getY():float
Returns
floatvalue of y element

 
 top of page
Method getZ
Get value of z element
Signature
getZ():float
Returns
floatvalue of z element

 
 top of page
Method init
Initialise values to x=a, y=b, z=c and w=d
Signature
init(floata,
  floatb,
  floatc,
  floatd 
  )  
Arguments
floatanew x value
floatbnew y value
floatcnew z value
floatdnew w value

 
 top of page
Method initScalef
Initialise vector to s*v
Signature
initScalef(Vector4fv,
  floats 
  )  
Arguments
Vector4fvVector4f instance
floatsscale to multiply

 
 top of page
Method mul
Multiply the x element of this instance with the x element of v and do the same with the y, z and w elements
Signature
mul(Vector4fv)
Arguments
Vector4fvVector4f instance

 
 top of page
Method mulf
Multiply this instance with scalar value v
Signature
mulf(floatv)
Arguments
floatvscalar value

 
 top of page
Method New
Initialise and return new Vector4f instance with x=a, y=b, z=c and w=d
Signature
New(floata,
  floatb,
  floatc,
  floatd 
  )  
 :Vector4f
Arguments
floatanew x value
floatbnew y value
floatcnew z value
floatdnew w value
Returns

 
 top of page
Method rotate
Multiply matrix by this vector and replace this vector by the result
Signature
rotate(Matrix4fm)
Arguments
Matrix4fmMatrix4f instance (rotation matrix)
Description

This is a convenience method to remove the need for temporary Vector4f variables in scripts (the temporary is created on the stack instead).

 
 top of page
Method setW
Set w element to a
Signature
setW(floata)
Arguments
floatanew value for w

 
 top of page
Method setX
Set x element to a
Signature
setX(floata)
Arguments
floatanew value for x

 
 top of page
Method setY
Set y element to a
Signature
setY(floata)
Arguments
floatanew value for y

 
 top of page
Method setZ
Set z element to a
Signature
setZ(floata)
Arguments
floatanew value for z

 
 top of page
Method sub
Substract another vector v from this instance
Signature
sub(Vector4fv)
Arguments
Vector4fvvector to substract

 
 top of page
Method tensor
Create resulting matrix of tensor product from this instance and v
Signature
tensor(Vector4fv)
 :Matrix4f
Arguments
Vector4fv
Returns
Matrix4fMatrix4f instance

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

 
 top of page
Method unitScale
Set length to s
Signature
unitScale(floats)
Arguments
floatsnew length of vector

 
 top of page
 

Project Modules:tkmath 
Project Classes:Complexd , Complexf , Math , Matrix , Matrix2d , Matrix2f , 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 , floord , floorf , hypotd , hypotf , log10d , log10f , log2d , log2f , logcd , logcf , logd , logf , matrix2d , matrix2f , 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 , ui 
All Projects:core , debugtext , tkfreetype2 , tkmath , tkmidi , tkopengl , tkportaudio , tksdl , tkui , tkunit 


auto-generated by "DOG", the TkScript document generator. Mon, 28/Dec/2015 13:15:54