Skip to content
Discussion options

You must be logged in to vote

Thanks for the detailed follow-up.

but that would lead to unnecessary evaluation of trigonometric functions and would give an overly verbose expression that obscures the intent.

Please note that my spherical vectors are only facades and they do not provide all the arithmetic exactly to prevent this noise. You need to convert to a Cartesian vector once and stay there as long as you want. For a direction that is already Cartesian, like your orbit case, you should not reach for spherical vectors at all.

vector = magnitude*unitless_vector

This turned out to be a real bug on our side, and I have fixed it (should be online in the Compiler Explorer tomorrow). Scaling a Cartesian vector by a …

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@mpusz
Comment options

mpusz Jul 8, 2026
Maintainer

@mpusz
Comment options

mpusz Jul 8, 2026
Maintainer

@sebsassi
Comment options

@mpusz
Comment options

Answer selected by sebsassi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants