Spherical Coordinates

Hello Out there!

I am just a Grasshopper beginner, and I wish to share this definition for spherical coordinates, I did.

I was using Kangaroo 2, and felt the need to use the wind with spherical coordinates in degrees and the vector lenghts.

This definition bakes a vector in any direction but with more control in degrees with azimuth and elevation angles.

Nonetheless, there are some minor errors:

I wish the pointer to scale backwards from the tip to the base. it´s a pyramid from weaverbird, and also select any origin in the coordinate space, so the definition works anywhere in space when set to a new origin point.

Does anyone know how to do these two things?

Spherical Coordinate 3.gh (20.7 KB)

Sure, but you are aware there are components for spherical points, namely Point Polar which creates XYZ points from polar coords and To Polar which gets polar coords from a XYZ point?

Hi Francisco,

Do you mean like this?

I’ve added an example of how this can be done to your gh definition. You need to place the base plane of the arrow at the coordinate origin and orient it to a vector from origin to target point. You also have to make sure your origin offset sliders apply to all elements.

Spherical Coordinate 3 with example.gh (29.7 KB)

HTH
Jeremy

A simplification of the definition without the custom arrow head geometry:


Spherical Coordinate VR 1.gh (26.1 KB)

@jeremy5 I think your definition fails if the base plane for the polar coordinate is not XY parallel?


You could also use casting to avoid the trignometry:


Spherical Coordinate VR 3.gh (17.5 KB)