Post Reply 
Plotting curve f(x,y,z) with HP Prime
11-20-2014, 07:59 AM (This post was last modified: 11-20-2014 08:17 AM by Han.)
Post: #3
RE: Plotting curve f(x,y,z) with HP Prime
Here's some code you can modify:

Code:
#cas
PPLOT(a,c,t0,tn,dt):=
BEGIN
  local n:=1,l;
  r(t):=[a*cos(t),a*sin(t),c*t];
  ptdef:=MAKELIST(r(X),X,t0,tn,dt);
  n:=size(ptdef)-1;
  ldef:=MAKELIST({X,X+1},X,1,n);
  l:=LINE_P(ptdef,ldef,
    {
      [[1,0,0,0],[0,1,0,0],[0,0,1,15]], 
      "N",
      {-160,-120,16*15},
      {-a,a,-a,a,c*t0,c*tn} 
    });
  freeze;
  return 0;
END;
#end

The matrix in the code is a 3x4 matrix used for perspective projection. The first three columns correspond to the 3x3 matrix resulting form the product of the three rotation matrices (about each axis). The last column is simply the eyepoint vector <0,0,d>. You'll need to adjust the 15 so that the distance d is larger than the distance from the center of the viewing box to the corner farthest from the center of the viewing box (similarly for the 16*15 value).

Edit: If you need help writing your own program, just post on the forums here and I'm sure someone will help. I've been thinking about creating a 3D parametric plot app but am already buried deep in other projects (also 3D related).

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Plotting curve f(x,y,z) with HP Prime - Han - 11-20-2014 07:59 AM



User(s) browsing this thread: 1 Guest(s)