cartesian coordinates of a sphere with angles at vector relative to surface of sphere

32 Views Asked by At
}

}

Hi, sorry if this is a simple problem, but I just can't seem to find any articles or information that exactly matches what I'm looking for.

I am coding in Epson robotics language, but I can convert from c# or python, just need to get the formula. I can handle the rest.

I have a robot that uses a point file X,Y,Z,U,V,W this handles the cartesian coordinates "XYZ" then UVW are the rotation and the latitude and longitude.

I am trying to plot a sphere and have the robot keep the tooling perpendicular to the surface of this sphere.

float Radius = 30; float Hx = 0; float Hy = 0; float Hz = 0; float Hu = 0; float Hv = 0; float Hw = 0;

for(int Lat = 1;Lat <= 180;Lat +=1) { for(int Long = 0;Long <=360; Long += 1) { Hx = Radius * (Sin(DegToRad(Lat)) * Sin(DegToRad(Long))) Hy = Radius * (Sin(DegToRad(Lat)) * Cos(DegToRad(Long))) Hz = Radius * Cos(DegToRad(Lat))

Hu = ???????? Hv = ???????? Hw = ????????

Go OriginPoint +X(Hx) +Y(Hy) +Z(Hz) +V(Hv) +W(Hw) } }

0

There are 0 best solutions below