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

  • SEARCH
  • Home
  • 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 922301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:00:26+00:00 2026-05-15T19:00:26+00:00

This is a class assignment. I had written some codes which I hope someone

  • 0

This is a class assignment. I had written some codes which I hope someone can help me.

alt text

This is the code that I have

% --- This is optional to verify whether my parametrization is consistent with the
% --- original equation
% syms x y z p t
% ellipsoid=[2*sin(p)*cos(t),4*sin(t)*sin(p),sqrt(2)*cos(p)]
% simplify(subs((x^2/4)+(y^2/16)+(z^2/2),[x,y,z],ellipsoid))
% --- END

t=linspace(-2,2*pi,20);
s=linspace(0,pi/2,20);

[s t]=meshgrid(s,t);

x=2*cos(t).*sin(s); 
y=4.*sin(s).*sin(t); 
z=sqrt(2).*cos(s);

surf(x,y,z); 
grid on;

xlabel('x');ylabel('y');zlabel('z'); axis equal

hold on;
% I think this is how we draw the lower half of the ellipsoid using -sqrt(2)
t=linspace(-2,2*pi,20);
s=linspace(0,pi/2,20);

[s t]=meshgrid(s,t);

x=-2.*cos(t).*sin(s); y=-4.*sin(s).*sin(t); z=-sqrt(2).*cos(s);
surf(x,y,z)
axis equal

The second way to do it is using ellipsoid comment which is the second part of this problem.

[x, y, z] = ellipsoid(0,0,0,2.0,4.0,sqrt(2),20);
surfl(x, y, z)
colormap copper
axis equal

The outupt image please click on the link below (too big)

http://i26.tinypic.com/6ye1j7.jpg
The left side is Part a, and right image is using ellipsoid…

Do you think they are the same?

Thank you

  • 1 1 Answer
  • 2 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-15T19:00:27+00:00Added an answer on May 15, 2026 at 7:00 pm

    Yes, they’re pretty much the same.

    You can test it by plotting both ellipsoids in the same axes, i.e. after you plotted the first ellipsoid, you run

    [x, y, z] = ellipsoid(0,0,0,2.0,4.0,sqrt(2),20);
    sh = surfl(x, y, z); %# capture the handle, i.e. the unique identifier, of the surface
    
    %# set color to gray, make mostly transparent
    set(sh,'FaceColor',[0.5,0.5,0.5],'FaceAlpha',0.5)
    

    Now you can rotate the plot (click on the button with the circlular arrow, then drag the plot) and you’ll see that the two ellipsoids coincide very well. If the second one was bigger than the first one, you’d see a space between the two; if the second one was smaller than the first one, you would only see the first, opaque one.

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

Sidebar

Related Questions

Can I optimize the class assignment here at all? I have to do this
So I was writing some code, and I had something like this: class Box
For this assignment I had to create my own string class. I initially wrote
I used FxCop to analyze some code I had written. I had exposed a
For an assignment, I had to code a due date which is 30 days
I recently wrote a class for an assignment in which I had to store
I was doing an assignment and had an update class which accepted the SQL
I'm working on a class assignment that started small, so I had it all
I have this assignment based on coin and card games which is very simplified.
This is an assignment i am working on for class. To make a long

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.