Skip to content

Commit fbc2ae2

Browse files
markuswntrstephentyrone
authored andcommitted
Update documentation on 3D transformations
1 parent 91d21e6 commit fbc2ae2

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Sources/QuaternionModule/Quaternion.swift

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import RealModule
3737
/// important to be aware that, when used this way, any quaternion and its
3838
/// negation represent the same transformation, but they do not compare equal
3939
/// using `==` because they are not the same quaternion.
40-
/// You can compare quaternions as 3D transformations using `transformEquals()`.
40+
/// You can compare quaternions as 3D transformations using `equals(as3DTransform:)`.
4141
public struct Quaternion<RealType> where RealType: Real & SIMDScalar {
4242

4343
/// The components of the 4-dimensional vector space of the quaternion.
@@ -401,7 +401,7 @@ extension Quaternion: Hashable {
401401
/// important to be aware that, when used this way, any quaternion and its
402402
/// negation represent the same transformation, but they do not compare
403403
/// equal using `==` because they are not the same quaternion. You can
404-
/// compare quaternions as 3D transformations using `transformEquals()`.
404+
/// compare quaternions as 3D transformations using `equals(as3DTransform:)`.
405405
@_transparent
406406
public static func == (lhs: Quaternion, rhs: Quaternion) -> Bool {
407407
// Identify all numbers with either component non-finite as a single "point at infinity".
@@ -413,13 +413,16 @@ extension Quaternion: Hashable {
413413
return lhs.components == rhs.components
414414
}
415415

416-
/// Transformation equality comparison
416+
/// Returns a Boolean value indicating whether the 3D transformation of the
417+
/// two quaternions are equal.
417418
///
418-
/// Returns a Boolean value indicating whether the 3D transformations of this
419-
/// quaternion equals the 3D transformation of `other`.
419+
/// Use this method to test for equality of the 3D transformation properties
420+
/// of quaternions; where for any quaternion `q`, its negation represent the
421+
/// same 3D transformation; i.e. `q.equals(as3DTransform: q)` as well as
422+
/// `q.equals(as3DTransform: -q)` are both `true`.
420423
///
421424
/// - Parameter other: The value to compare.
422-
/// - Returns: True if the transformation of this quaternion equals `other`.
425+
/// - Returns: True if the 3D transformation of this quaternion equals `other`.
423426
@_transparent
424427
public func equals(as3DTransform other: Quaternion) -> Bool {
425428
// Identify all numbers with either component non-finite as a single "point at infinity".

0 commit comments

Comments
 (0)