There is a point at [xp,yp,zp].

Its origin at [xc,yc,zc].

I need angles of line from [xc,yc,zc] to [xp,yp,zp] with respect to axes of origin as shown below.

something to do with atan? not sure of the maths. Any help welcomed

There is a point at [xp,yp,zp].

Its origin at [xc,yc,zc].

I need angles of line from [xc,yc,zc] to [xp,yp,zp] with respect to axes of origin as shown below.

something to do with atan? not sure of the maths. Any help welcomed

If I remember correctly it was not as easy as it seems.

You have to use a spherical coordinate system to calculate the angles from the origin (0,0,0) to the Point. You may also have to make an additional coordinate transformation to get your first point into the origin.

https://en.wikipedia.org/wiki/Spherical_coordinate_system

Hope it helps. Maybe I’m wrong. Some years back in the university …

dino

Hi there,

I’d suggest researching it and making your own op. Here’s a short tutorial video on how to code your own simple math op. We have an entire channel and github repo with clear easy examples.

Making an op with 6 float inputs and the output should be enough.

Hi,

I wrote a custom Op to get the angles between 2 points and the length of the Vektor. Input and Output are Arrays. Based on the spherical coordinate system. Unfortunately with some modifications I was not expecting.

You can have a look here: https://cables.gl/p/5e988396d8a0905e771a6cda

Input 1 Origin [xc,yc,zc], Input 2 Point [xp,yp,zp]

Output 1 Angle, Output 2 Vektor lenght, Output 3 Number of points.

To get it working I had to modify the MeshInstancer as it is important in which order the rotations are executed.

Can you give me feedback if that was what you where looking for?

I can share the code if you want to have a look.

Cheers,

dino