POV-Ray : Newsgroups : povray.newusers : 2D Sin curve : Re: 2D Sin curve Server Time
5 Nov 2024 05:22:35 EST (-0500)
  Re: 2D Sin curve  
From: Warp
Date: 1 Sep 2000 09:53:14
Message: <39afb4ca@news.povray.org>
Ulrik <ulr### [at] hempassagense> wrote:
: I'm just wondering if it's possible to use POV to help me draw 2D sin curves

  Of course.


#macro Function(X)
  sin(X)
#end

#declare Step=.1;
#declare CurveThickness=.03;

#declare GridSize=10;
#declare GridThickness=.025;

//----------------------------------------------------------------------------
#default { finish { ambient 1 } }
camera { location -z*10 look_at 0 angle 45 orthographic }


#declare Ind=-GridSize/2;
#while(Ind<=GridSize/2)
  #declare Col=(Ind=0?y:z);
  cylinder
  { <Ind,-GridSize/2,GridThickness><Ind,GridSize/2,GridThickness>,GridThickness
    pigment { rgb Col }
  }
  cylinder
  { <-GridSize/2,Ind,GridThickness><GridSize/2,Ind,GridThickness>,GridThickness
    pigment { rgb Col }
  }
  #declare Ind=Ind+1;
#end

union
{ #declare X=-GridSize/2;
  #declare oPos=<X,Function(X),0>;
  #declare X=X+Step;
  #while(X<=GridSize/2)
    #declare Pos=<X,Function(X),0>;
    cylinder { oPos, Pos, CurveThickness }
    sphere { Pos, CurveThickness }
    #declare oPos=Pos;
    #declare X=X+Step;
  #end
  pigment { rgb 1 }
}


-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):_;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.