help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Code help


From: Rahul Chaudhry
Subject: Code help
Date: Sat, 27 Aug 2016 15:05:12 -0400

Hello, I am working on trying to rotate the smaller ellipsoid, which I call a pseudopod in this code, but I am not sure how to do so.  where in my code can this be accomplished?
__________________________________________________________________________-
close all; clear all; clc;
% define parameters for platelet body
a = 1.4; b = 1.4; c = .6;

% center of the platelet body
xc = 0; yc = 0; zc = 0;

% define parameters for pseudopod
ap = 2; bp = 0.3; cp = 0.3;

% center of the pseudopod body
xcp = 0; ycp = 0; zcp = 0;


% density of the mesh grid
  n = 30;

% declaring the theta vector to traverse 360 degree
theta = linspace (0, 2 * pi, n + 1);

% declaring the phi vector to traverse 180 degree
phi = linspace (-pi / 2, pi / 2, n + 1);

% creating the meshgrid for the bottom x-y plane.
[theta, phi] = meshgrid (theta, phi);

% calculation of x, y and z components.
x = a .* cos (phi) .* cos (theta) + xc;
y = b .* cos (phi) .* sin (theta) + yc;
z = c .* sin (phi) + zc;

% plotting routines.
figure
surf(x, y, z, 'EdgeColor','none','LineStyle','none');
hold on;

% the description below is the same as above with the
% difference that the parameter set is for pseudopod.

xb = ap .* (cos (phi)) .* cos (theta) + xcp;
yb = bp .* (cos (phi)).* sin (theta) + ycp;
zb = cp .* (sin (phi)) + zcp;

% plotting routines.
surf(xb, yb, zb, 'EdgeColor','none','LineStyle','none');
hold on;

view(40, 40)
hold on;

axis equal

reply via email to

[Prev in Thread] Current Thread [Next in Thread]