The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 create a surface of a sphere

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
belsebub01 Posted - 04/20/2010 : 2:58:12 PM
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8 SR4
Operating System: Win 7

I have a project to create a surface of a sphere with gridlines. For this I need to create a matrix, hope I'm right.

I want to use the function for a shere: x²+y²+z²=r² , but I don't find a solution to convert this function into a matrix. Can anybody help???

Thanks a lot!
2   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 04/22/2010 : 1:56:57 PM
Before everyone wears a hole in their head from all that scratching, I'd like to point out two things:

In 8.0 we did not support hiding of missing values, so your version will display a plane at z = 0.

As of Origin 8.1, we do not yet fully support multiple matrices in a surface plot. If you create the graph, you will find that display order or certain rotation angles will not result in a correct display.
Sam Fang Posted - 04/21/2010 : 11:07:06 PM
Assume that R=10. Create two matrix objects in the MSheet, select Matrix: Set Dimensions from Origin menu. Set X from -10 to 10. Y from -10 to 10. Type the following script in the command window.

range mz = [MBook1]MSheet1!1;
range mz2 = [MBook1]MSheet1!2;
dxx = (mz.x2 - mz.x1)/(mz.ncols - 1);
dyy = (mz.y2 - mz.y1)/(mz.nrows - 1);
for( ii = 1; ii <= mz.nrows; ii++)
  for( jj = 1; jj <= mz.ncols; jj++)
  {
    xa  =  mz.x1 + dxx*( jj - 1);
    ya = mz.y1 +dyy*( ii - 1);
    if( xa^2 + ya^2 <= 10^2 )
    {
      mz[ii, jj] = sqrt(10^2 - xa^2 - ya^2);
      mz2[ii, jj] = -sqrt(10^2 - xa^2 - ya^2);
    }
    //Refine the border of XY domain
    else if( xa^2 + ya^2 <= ( 10 + sqrt(dxx^2 + dyy^2) )^2)
    {
      mz[ii, jj] = 0;
      mz2[ii, jj] = 0;
    }
    else
    {
      mz[ii, jj] = 1/0;
      mz2[ii, jj] = 1/0;
    }
  }

Two matrix objects correspond to the top and bottom sphere. Note that missing values will be set beyond the XY domain of the sphere.

The following graph is created using Origin with two matrix objects of 101 columns and 101 rows.


Sam
OriginLab Technical Services

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000