# Class: Fox::FXQuatd

Inherits:
FXVec4d
show all
Defined in:
rdoc-sources/FXQuatd.rb

#w, #x, #y, #z

## Instance Method Summary collapse

• Compute the rotation of a vector vec by this quaternion; returns the rotated vector (a new FXVec3d instance).

• Adjust quaternion length; returns a reference to self.

• Construct a quaternion from arc a->b on unit sphere and return a reference to self.

• Return the conjugate of this quaternion (a new FXQuatd instance).

• Return the exponentiation of this quaternion (a new FXQuatd instance).

• Get quaternion axes; returns a 3-element array of FXVec3d instances.

• Return the rotation axis and angle for this quaternion, i.e.

• Obtain roll, pitch and yaw angles (in radians) from quaternion, e.g.

• Obtain local x axis (an FXVec3d instance).

• Obtain local y axis (an FXVec3d instance).

• Obtain local z axis (an FXVec3d instance).

• constructor

Construct quaternion from axes; ex, ey and ez are all FXVec3d instances.

• Return the inverse of this quaternion (a new FXQuatd instance).

• Spherical lerp and return a reference to self.

• Return the logarithm of this quaternion (a new FXQuatd instance).

• Set quaternion from axes; ex, ey and ez are all FXVec3d instances.

• Set quaternion from rotation axis and angle.

• Set quaternion from yaw (z), pitch (y) and roll (x).

• Invert unit quaternion (returns a new FXQuatd instance).

## Constructor Details

### #initialize(ex, ey, ez) ⇒ FXQuatd

Construct quaternion from axes; ex, ey and ez are all FXVec3d instances.

 ``` 4``` ```# File 'rdoc-sources/FXQuatd.rb', line 4 def initialize; end```

## Instance Method Details

### #*(vec) ⇒ Object

Compute the rotation of a vector vec by this quaternion; returns the rotated vector (a new FXVec3d instance).

#### Parameters:

`vec`

the vector to be rotated Fox::FXVec3d

 ``` 130``` ```# File 'rdoc-sources/FXQuatd.rb', line 130 def *(other); end```

Adjust quaternion length; returns a reference to self.

 ``` 47``` ```# File 'rdoc-sources/FXQuatd.rb', line 47 def adjust!; end```

### #arc!(a, b) ⇒ Object

Construct a quaternion from arc a->b on unit sphere and return a reference to self.

#### Parameters:

`a`

Fox::FXVec3d

`b`

Fox::FXVec3d

 ``` 151``` ```# File 'rdoc-sources/FXQuatd.rb', line 151 def arc!(a, b); end```

### #conj ⇒ Object

Return the conjugate of this quaternion (a new FXQuatd instance).

 ``` 125``` ```# File 'rdoc-sources/FXQuatd.rb', line 125 def conj; end```

### #exp ⇒ Object

Return the exponentiation of this quaternion (a new FXQuatd instance).

 ``` 105``` ```# File 'rdoc-sources/FXQuatd.rb', line 105 def exp; end```

### #getAxes ⇒ Object

Get quaternion axes; returns a 3-element array of FXVec3d instances.

 ``` 91``` ```# File 'rdoc-sources/FXQuatd.rb', line 91 def getAxes(); end```

### #getAxisAngle ⇒ Object

Return the rotation axis and angle for this quaternion, i.e.

``````axis, angle = aQuaternion.getAxisAngle()
``````

where axis is an FXVec3d instance and angle is the angle of rotation in radians.

 ``` 67``` ```# File 'rdoc-sources/FXQuatd.rb', line 67 def getAxisAngle(); end```

### #getRollPitchYaw ⇒ Object

Obtain roll, pitch and yaw angles (in radians) from quaternion, e.g.

``````roll, pitch, yaw = aQuaternion.getRollPitchYaw()
``````
 ``` 85``` ```# File 'rdoc-sources/FXQuatd.rb', line 85 def getRollPitchYaw(); end```

### #getXAxis ⇒ Object

Obtain local x axis (an FXVec3d instance).

 ``` 94``` ```# File 'rdoc-sources/FXQuatd.rb', line 94 def getXAxis(); end```

### #getYAxis ⇒ Object

Obtain local y axis (an FXVec3d instance).

 ``` 97``` ```# File 'rdoc-sources/FXQuatd.rb', line 97 def getYAxis(); end```

### #getZAxis ⇒ Object

Obtain local z axis (an FXVec3d instance).

 ``` 100``` ```# File 'rdoc-sources/FXQuatd.rb', line 100 def getZAxis(); end```

### #invert ⇒ Object

Return the inverse of this quaternion (a new FXQuatd instance).

 ``` 115``` ```# File 'rdoc-sources/FXQuatd.rb', line 115 def invert; end```

### #lerp!(u, v, f) ⇒ Object

Spherical lerp and return a reference to self.

#### Parameters:

`u`

Fox::FXQuatd

`v`

Fox::FXQuatd

`f`
Float
 ``` 162``` ```# File 'rdoc-sources/FXQuatd.rb', line 162 def lerp!(u, v, f); end```

### #log ⇒ Object

Return the logarithm of this quaternion (a new FXQuatd instance).

 ``` 110``` ```# File 'rdoc-sources/FXQuatd.rb', line 110 def log; end```

### #setAxes(ex, ey, ez) ⇒ Object

Set quaternion from axes; ex, ey and ez are all FXVec3d instances.

 ``` 88``` ```# File 'rdoc-sources/FXQuatd.rb', line 88 def setAxes(ex, ey, ez); end```

### #setAxisAngle(axis, phi = 0.0) ⇒ Object

Set quaternion from rotation axis and angle.

#### Parameters:

`axis`

the rotation axis Fox::FXVec3d

`angle`

the rotation angle (in radians) [Float]

 ``` 57``` ```# File 'rdoc-sources/FXQuatd.rb', line 57 def setAxisAngle(axis, phi=0.0); end```

### #setRollPitchYaw(roll, pitch, yaw) ⇒ Object

Set quaternion from yaw (z), pitch (y) and roll (x).

#### Parameters:

`roll`

`pitch`

`yaw`
 ``` 78``` ```# File 'rdoc-sources/FXQuatd.rb', line 78 def setRollPitchYaw(roll, pitch, yaw); end```
 ``` 120``` ```# File 'rdoc-sources/FXQuatd.rb', line 120 def unitinvert; end```