Path: news.mathworks.com!not-for-mail From: <HIDDEN> Newsgroups: comp.soft-sys.matlab Subject: Re: Ellipsoid Date: Sun, 28 Nov 2010 23:52:03 +0000 (UTC) Organization: The MathWorks, Inc. Lines: 26 Message-ID: <icupv3$8ad$1@fred.mathworks.com> References: <icso5g$33l$1@fred.mathworks.com> <icsrgb$3ue$1@fred.mathworks.com> <icu950$nsb$1@fred.mathworks.com> Reply-To: <HIDDEN> NNTP-Posting-Host: webapp-05-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1290988323 8525 172.30.248.35 (28 Nov 2010 23:52:03 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Sun, 28 Nov 2010 23:52:03 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 1187260 Xref: news.mathworks.com comp.soft-sys.matlab:690720 "Robert Phillips" <phillir1@my.erau.edu> wrote in message <icu950$nsb$1@fred.mathworks.com>... > Thanks for replying so quickly. > > So if I want to generate points on the surface of the ellipsoid, would I set > > XR^2/a^2 + YR^2/b^2 + ZR^2/c^2 = 1? > > Also.. how exactly do I go about generating those points? It would make sense to maybe use embedded for-loops, but I imagine there's a better way to do this. > > Further, isn't it possible to use the ellipsoid function > ellipsoid(S_x, S_y, S_z, norm(a_S), norm(b_S), norm(c_S)) > to generate the points, and then use some kind of coordinate transformation matrix to place all of the points along the local a_S,b_S,c_S axes? - - - - - - - - - - I'm afraid I read your original request too hastily. I read it to mean that you were testing to see if a given point P lay inside the ellipsoid. My apologies. To generate an ellipsoid relative to a_S, b_S,and c_S axes with center at S, I would first use the 'ellipsoid' function to generate an ellipsoid with center at (0,0,0) and a,b,c semi-axes lengths to produce n+1 by n+1 arrays X, Y, Z. Then use these in the expressions x = S(1) + X*a_S(1) + Y*b_S(1) + Z*c_S(1); y = S(2) + X*a_S(2) + Y*b_S(2) + Z*c_S(2); z = S(3) + X*a_S(3) + Y*b_S(3) + Z*c_S(3); You should be able to use these x, y, and z arrays directly in 'surf'. I have again assumed that a_S, b_S, and c_S are unit vectors and mutually orthogonal. Roger Stafford