Skip to content

Commit

Permalink
add docsting to quat
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrodium committed Dec 1, 2022
1 parent 9c62d64 commit fe16ec7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Quaternion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,23 @@ Quaternion{Int64}(0, 1, 2, 3)
"""
quat

"""
quat(r, [i, j, k])
Convert real numbers or arrays to quaternion. `i, j, k` defaults to zero.
# Examples
```jldoctest
julia> quat(7)
Quaternion{Int64}(7, 0, 0, 0, false)
julia> quat([1, 2, 3])
3-element Vector{Quaternion{Int64}}:
Quaternion{Int64}(1, 0, 0, 0, true)
Quaternion{Int64}(2, 0, 0, 0, false)
Quaternion{Int64}(3, 0, 0, 0, false)
```
"""
quat(p, v1, v2, v3) = Quaternion(p, v1, v2, v3)
quat(x) = Quaternion(x)
quat(s, a) = Quaternion(s, a)
Expand Down

0 comments on commit fe16ec7

Please sign in to comment.