Skip to content

Commit 61f5bd4

Browse files
Made similar code even more similar.
1 parent 718b9a6 commit 61f5bd4

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/Math-Quaternion/PMQuaternion.class.st

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,15 @@ PMQuaternion >> ln [
354354
| z |
355355
z := self unreal abs.
356356
^ z isZero
357-
ifTrue: [ self abs ln + (z arcTan: qr) i + qj j + qk k ]
357+
ifTrue: [
358+
| vectorPart |
359+
vectorPart := 0 + (z arcTan: qr) i + qj j + qk k.
360+
self abs ln + vectorPart ]
358361
ifFalse: [
359-
| theta |
362+
| theta vectorPart |
360363
theta := (z arcTan: qr) / z.
361-
self abs ln + (theta * (0 + qi i + qj j + qk k)) ]
364+
vectorPart := theta * (0 + qi i + qj j + qk k).
365+
self abs ln + vectorPart ]
362366
]
363367

364368
{ #category : #'mathematical functions' }

0 commit comments

Comments
 (0)