Skip to content

Commit 6e12349

Browse files
authored
note named access for SVector in FieldVector docs (#983)
* note named access for SVector in FieldVector docs * Update api.md
1 parent 6b82c49 commit 6e12349

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

docs/src/pages/api.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,10 @@ even permute the coordinates with `p[SVector(3,2,1)]`). Furthermore, `Point3D`
189189
is a complete `AbstractVector` implementation where you can add, subtract or
190190
scale vectors, multiply them by matrices, etc.
191191

192+
*Note*: the three components of an ordinary `v::SVector{3}` can also be
193+
accessed as `v.x`, `v.y`, and `v.z`, so there is no need for a `FieldVector`
194+
to use this convention.
195+
192196
It is also worth noting that `FieldVector`s may be mutable or immutable, and
193197
that `setindex!` is defined for use on mutable types. For immutable containers,
194198
you may want to define a method for `similar_type` so that operations leave the

0 commit comments

Comments
 (0)