Message Boards Message Boards

0
|
6078 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Drawing a line by SphericalPlot3D

Posted 9 years ago

Hi Under the function SphericalPlot3D, I want to draw a line along with my usual 3D surface. How can I do it. For example, say my surface is sphere of r = 1 and line segment having ends (1, Pi/3, Pi/6) and (3, Pi/6, Pi/3). Thanks S G

POSTED BY: S G
3 Replies
Posted 9 years ago

I suggest you experiment with FromSphericalCoordinates, ToSphericalCoordinates, and CoordinateTransform.

POSTED BY: Eric Rimbey
Posted 9 years ago

Dear Eric, Thanks for the response. I tried it this way but the two drawings are consistent with each other. Consider a line between points spherical points (30, 0, 0) and (30, 0, Pi). If we convert it to cartesian system, it is a line between (0, 0, 30) and (0, 0, -30) and hence should pass through origin along Z axis. Though when I tried it your way, it is not passing through the center of sphere, which is at origin. Please see the attached file. Thanks once again S G

Attachments:
POSTED BY: S G
Posted 9 years ago

You can combine Graphics objects in Show. Try something like this:

Show[Graphics3D[{Red, Thick, Line[{{1, Pi/3, Pi/6}, {3, Pi/6, Pi/3}}]}], SphericalPlot3D[1, theta, phi]]
POSTED BY: Eric Rimbey
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract