Hello,
I'm trying to plot some 3D points defined in spherical coordinates. (like this https://upload.wikimedia.org/wikipedia/commons/thumb/6/69/Kugelkoord-def.svg/300px-Kugelkoord-def.svg.png) So as specified in the wikipedia article[1] the spherical->carthesian conversion should works like this: x = r * sin(theta) * cos(phi) y = r * sin(theta) * sin(phi) z = r * cos(theta) My problem is now, that as documented in (set mapping spherical) gnuplot does the spherical->carthesian conversion like this: x = r * cos(theta) * cos(phi) y = r * sin(theta) * cos(phi) z = r * sin(phi) For me this seems like an odd non-standard way of doing things. But on the other side, I'm not really familiar with the whole thing. How can I achieve an output with correct corrdinates for my data? thanks in advace, Simon --------- script: set xlabel "x" set ylabel "y" set zlabel "z" set xrange [-1:1] set yrange [-1:1] set zrange [-1:1] set mapping spherical set angles degrees splot 'test.dat' pause -1 data: #theta phi r 0 0 1 90 180 1 [1] https://en.wikipedia.org/wiki/Spherical_coordinate_system#Cartesian_coordinates ------------------------------------------------------------------------------ Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j _______________________________________________ gnuplot-info mailing list [hidden email] Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info |
Am 13.05.2016 um 15:29 schrieb Simon Lenz:
> So as specified in the wikipedia article[1] the spherical->carthesian > conversion should works like this: That's overstating things a bit. The notion that there is "the" mapping is incorrect. There are various ways of defining spherical coordinates, not just one. And Wikipedia knows that, too. You just have to read the entire article, not just look at a single isolated formula. > For me this seems like an odd non-standard way of doing things. Given there is no actual standard, nothing can really be non-standard. gnuplot's spherical coordinates follow the conventions used in geography, where latitude zero is at the equator, instead of a pole. ------------------------------------------------------------------------------ Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j _______________________________________________ gnuplot-info mailing list [hidden email] Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info |
In reply to this post by Simon Lenz
Simon
In your data set you have the angles “theta” and “phi”. To know the correct set of equations you should inform two thinks: - Your “theta” angles is the horizontal angle or de vertical angle? - Your vertical angle starts on the vertical axis Z or in the horizontal plane? By knowing these answer it will be possible to define the equations without doubt. M. Galo ----- Mensagem original ----- De: "Simon Lenz" <[hidden email]> Para: [hidden email] Enviadas: Sexta-feira, 13 de maio de 2016 10:29:15 Assunto: [Gnuplot-info] Weird spherical mapping? Hello, I'm trying to plot some 3D points defined in spherical coordinates. (like this https://upload.wikimedia.org/wikipedia/commons/thumb/6/69/Kugelkoord-def.svg/300px-Kugelkoord-def.svg.png) So as specified in the wikipedia article[1] the spherical->carthesian conversion should works like this: x = r * sin(theta) * cos(phi) y = r * sin(theta) * sin(phi) z = r * cos(theta) My problem is now, that as documented in (set mapping spherical) gnuplot does the spherical->carthesian conversion like this: x = r * cos(theta) * cos(phi) y = r * sin(theta) * cos(phi) z = r * sin(phi) For me this seems like an odd non-standard way of doing things. But on the other side, I'm not really familiar with the whole thing. How can I achieve an output with correct corrdinates for my data? thanks in advace, Simon --------- script: set xlabel "x" set ylabel "y" set zlabel "z" set xrange [-1:1] set yrange [-1:1] set zrange [-1:1] set mapping spherical set angles degrees splot 'test.dat' pause -1 data: #theta phi r 0 0 1 90 180 1 [1] https://en.wikipedia.org/wiki/Spherical_coordinate_system#Cartesian_coordinates ------------------------------------------------------------------------------ Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j _______________________________________________ gnuplot-info mailing list [hidden email] Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info ------------------------------------------------------------------------------ Mobile security can be enabling, not merely restricting. Employees who bring their own devices (BYOD) to work are irked by the imposition of MDM restrictions. Mobile Device Manager Plus allows you to control only the apps on BYO-devices by containerizing them, leaving personal data untouched! https://ad.doubleclick.net/ddm/clk/304595813;131938128;j _______________________________________________ gnuplot-info mailing list [hidden email] Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info |
Free forum by Nabble | Edit this page |