Grasshopper

algorithmic modeling for Rhino

Hi All

 

How do i write forumula's like the ones below in GH as the Expression editor does not like the -1 outside brackets. Maths below converts from cartesian coordinates(x, y, z) into spherical coordinates (r, θ, φ)

 

r=\sqrt{x^2+y^2+z^2}
\theta=\cos^{-1} \left( \frac{z}{r}\right)
\varphi = \tan^{-1} \left( \frac{y}{x} \right)

Thanks
Matt

Views: 4957

Replies to This Discussion

The components ArcCos, ArcSin, and ArcTan if using native GH components and Asin, Acos and Atan if using inside an expresion

(x^2+y^2+z^2)^1/2

Acos(z/r)

Atan(y/x)

too

sqrt(x^2+y^2+z^2)

Attachments:

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service