Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6795691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:22:38+00:00 2026-05-26T18:22:38+00:00

I have three functions in spherical coordinates that I want to plot. They are

  • 0

I have three functions in spherical coordinates that I want to plot. They are functions of r,theta,phi and I want to view them in the x-y,y-z,x-z planes. I’ve tried accomplishing this for literally 8 hours. Every method I’ve tried has been unsuccessful.

How can I accomplish this phenomenally simple task?

F1 = (r.^2).*abs((1/(8*sqrt(pi))).*r.*exp(-r/2).*sin(theta).*cos(phi)).^2;
F2 = (r.^2).*abs((1/(8*sqrt(pi))).*r.*exp(-r/2).*sin(theta).*sin(phi)).^2;
F3 = (r.^2).*abs((1/(4*sqrt(2*pi))).*r.*exp(-r/2).*cos(theta)).^2;

As you can see, all three of the functions are F(r,theta,phi). That means that there are four dimensions: F,r,theta,phi.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T18:22:39+00:00Added an answer on May 26, 2026 at 6:22 pm

    If your functions cannot be expressed as r=f(theta,phi), maybe you can compute the value of f(theta,phi,r) over a grid and then plot an isosurface where your volume data equals your value twoPx.

    I tried this small example from which you can expand but I do not know if the shape is correct because I do not know what to expect:

    n=20;
    rmax=5;
    twoPx=0;
    %%%%%%%%%%
    [theta phi r]=ndgrid(linspace(0,2*pi,n),linspace(-pi/2,pi/2,n),linspace(0,rmax,n));
    %%%%%%%%%%
    value=(r.^2).*abs((1/(8*sqrt(pi))).*r.*exp(-r/2).*sin(theta).*cos(phi)).^2;
    %%%%%%%%%%
    [x y z]=sph2cart(theta,phi,r);
    %%%%%%%%%%
    p=patch(isosurface(x,y,z,value,twoPx));
    %%%%%%%%%%
    set(p,'FaceColor','b','EdgeColor','k','FaceAlpha',0.5);
    daspect([1 1 1])
    axis square;
    grid on;
    camlight;
    view([0 0]);
    

    A little explanation of what this snippet does:

    1. define a spherical grid (ndgrid)
    2. compute the value of your function on that grid
    3. compute the cartesian grid corresponding to the spherical grid (sph2cart)
    4. plot the isosurface where your volume equals twoPx (patch and isosurface)

    Finally you may want to use the Matlab function view to specify which plane you want to look from.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a function expressed in spherical coordinates: f(r,theta,phi) = 4*exp(-r)*cos(theta)*sin(phi) I'd like to
I have three custom functions that do very similar things: they pull different data
I have a simple JavaScript file that has three jQuery $document.ready functions. All three
If we have three functions (foo, bar, and baz) that are composed like so...
I have three functions that ought to be equal: let add1 x = x
I want to call three functions someTask1 , someTask2 and someTask3 in that order.
When you have a set of functions that have no interaction between them, you
I have three functions that return integer error codes, e.g. int my_function_1(const int my_int_param);
i have three functions which are returning an IEnumerable collection. now i want to
I have an iphone app where I call these three functions in appDidFinishLaunching: glMatrixMode(GL_PROJECTION);

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.