mirror of
https://github.com/apple/swift-numerics
synced 2026-11-27 05:04:26 +00:00
Update documentation on 3D transformations
This commit is contained in:
1 parent
e50371b030
commit
1fe4ce7b1f
1 file changed
+9
-6
@@ -37,7 +37,7 @@ import RealModule
|
||||
/// important to be aware that, when used this way, any quaternion and its
|
||||
/// negation represent the same transformation, but they do not compare equal
|
||||
/// using `==` because they are not the same quaternion.
|
||||
/// You can compare quaternions as 3D transformations using `transformEquals()`.
|
||||
/// You can compare quaternions as 3D transformations using `equals(as3DTransform:)`.
|
||||
public struct Quaternion<RealType> where RealType: Real & SIMDScalar {
|
||||
|
||||
/// The components of the 4-dimensional vector space of the quaternion.
|
||||
@@ -401,7 +401,7 @@ extension Quaternion: Hashable {
|
||||
/// important to be aware that, when used this way, any quaternion and its
|
||||
/// negation represent the same transformation, but they do not compare
|
||||
/// equal using `==` because they are not the same quaternion. You can
|
||||
/// compare quaternions as 3D transformations using `transformEquals()`.
|
||||
/// compare quaternions as 3D transformations using `equals(as3DTransform:)`.
|
||||
@_transparent
|
||||
public static func == (lhs: Quaternion, rhs: Quaternion) -> Bool {
|
||||
// Identify all numbers with either component non-finite as a single "point at infinity".
|
||||
@@ -413,13 +413,16 @@ extension Quaternion: Hashable {
|
||||
return lhs.components == rhs.components
|
||||
}
|
||||
|
||||
/// Transformation equality comparison
|
||||
/// Returns a Boolean value indicating whether the 3D transformation of the
|
||||
/// two quaternions are equal.
|
||||
///
|
||||
/// Returns a Boolean value indicating whether the 3D transformations of this
|
||||
/// quaternion equals the 3D transformation of `other`.
|
||||
/// Use this method to test for equality of the 3D transformation properties
|
||||
/// of quaternions; where for any quaternion `q`, its negation represent the
|
||||
/// same 3D transformation; i.e. `q.equals(as3DTransform: q)` as well as
|
||||
/// `q.equals(as3DTransform: -q)` are both `true`.
|
||||
///
|
||||
/// - Parameter other: The value to compare.
|
||||
/// - Returns: True if the transformation of this quaternion equals `other`.
|
||||
/// - Returns: True if the 3D transformation of this quaternion equals `other`.
|
||||
@_transparent
|
||||
public func equals(as3DTransform other: Quaternion) -> Bool {
|
||||
// Identify all numbers with either component non-finite as a single "point at infinity".
|
||||
|
||||
Reference in new issue
Block a user