Back to index

wims  3.65+svn20090927
Classes | Public Member Functions | Package Attributes
sinus Class Reference
Inheritance diagram for sinus:
Inheritance graph
[legend]
Collaboration diagram for sinus:
Collaboration graph
[legend]

List of all members.

Classes

class  cos
class  sin

Public Member Functions

void init ()
void paint (Graphics g1)
void mousePressed (MouseEvent e)
void update (Graphics g1)
void mouseDragged (MouseEvent e)
void mouseReleased (MouseEvent e)
void mouseMoved (MouseEvent e)
void mouseClicked (MouseEvent e)
void mouseEntered (MouseEvent e)
void mouseExited (MouseEvent e)
String getAppletInfo ()
String ReadApplet ()
void start ()
void stop ()
void destroy ()

Package Attributes

Image img
Graphics g
Graphics g1
Repere R
Repere R1
pt O
pt P
pt Px
pt Py
pt Pcosx
pt endpoint1
pt endpoint2
pt pp1
pt pp2
PointSurDroite O1
Cercle C
Cercle Cenr
ArcDeCercle IM
Droite xas
Droite yas
Droite hline
PointSurCercle M
Vecteur Endpoint
Segment straal
Segment OPx
Segment OPy
Segment value
Segment proj
CourbeDeFonction functie
sin sfunctie
cos cfunctie
int aNp
int periodes = 0
double ap = 1.0
double pi2
int X
int Y
int Xret
int Yret
int modepaint = -1
double degrees
double absdegrees = 0
int use_degrees = 1
double start = 0
double end = 0
int type = 0
int xz
int yz
double scale = 7.0
double minscale = 7.0
int use_end = 0
int units = 1
int curve = 1
double yP
String rem1 = "Only point P [on the circle] can be rotated..."
String rem2 = "zooming out..."
String rem3 = "\u03C0 radians"
String rem4 = "the angle = "
String rem5 = " The unit circle"

Detailed Description

Definition at line 69 of file sinus.java.


Member Function Documentation

void sinus.destroy ( ) [inline]

Definition at line 328 of file sinus.java.

{}
String sinus.getAppletInfo ( ) [inline]

Definition at line 305 of file sinus.java.

  { return "Written by J.P. Quelen\nModified for WIMS \n J.M. Evers 3/2008" ; }
void sinus.init ( ) [inline]

Definition at line 88 of file sinus.java.

                      {
       String param;
       param=getParameter("language");if(param!=null && param.length()>0){
           if(param.equalsIgnoreCase("nl")){
              rem1="Alleen het punt P [op de cirkel] kan worden bewogen...";
              rem2="uitzoomen...";
              rem3="\u03C0 radialen";
              rem4="de hoek = ";
              rem5=" De eenheids cirkel";
           }
           if(param.equalsIgnoreCase("fr")){
              rem1="Seulement point P [sur le cercle] peut être tourné ...";
              rem2="zoomer en plan général...";
              rem3="\u03C0 radians";
               rem4="angle = ";
              rem5=" Cercle unité";
           }
       }
       param=getParameter("functiontype");if(param!=null && param.length()>0){if(param.equalsIgnoreCase("cos")){type=1;}}
       param=getParameter("show_curve");if(param!=null && param.length()>0){if(param.equalsIgnoreCase("no")){curve=0;scale=4;minscale=4;}}
       param=getParameter("Xaxis_units") ;if(param!=null && param.length()>0){if(param.equalsIgnoreCase("no" )){units=0;}}
        param=getParameter("degrees");
       if(param!=null && param.length()>0){
           if(param.equalsIgnoreCase("no")){
              use_degrees=0;
           }
           else
           {  
              if(param.equalsIgnoreCase("radians") || param.equalsIgnoreCase("rad") ){use_degrees=2;}
           }
       }
        param=getParameter("start");if(param!=null && param.length()>0){start=(double) Integer.parseInt(param, 10);  }
        param=getParameter("end");if(param!=null && param.length()>0){end=(double) Integer.parseInt(param, 10); use_end=1;}   
       setBackground(Color.white);modepaint = 1 ;
       periodes = 0 ;
       pi2 = Math.PI * 2.0;
       img = createImage(getSize().width, getSize().height);g = img.getGraphics();
       addMouseMotionListener(this);addMouseListener(this);
       xz=getSize().width/2;yz=getSize().height/2;
       R   = new Repere(xz,yz, getSize().width, getSize().height,(double)(getSize().height / 2 - 20),(double)(getSize().height / 2 - 20));
       R1  = new Repere(xz,yz, getSize().width, getSize().height,getSize().width/scale,getSize().width/scale);
       xas = new Droite(0.0, 1.0, 0.0, "", R1);
       yas = new Droite(1.0, 0.0, 0.0, "", R1);
       O1  = new PointSurDroite(xz,yz, xas, "O", R1);
       O   = new PointSurDroite(xz,yz, xas, "O", R1);
       C   = new Cercle(O1, 1.0, "", R1);
       Cenr= new Cercle(O1, 1.0, "", R1);
       M   = new PointSurCercle(start*pi2/360, C, "P", R1);
       straal= new Segment(O1.x,O1.y,M.x,M.y,"",R1);
       Px  = new point(M.x,0, "P'", R1);
       Py  = new point(0,M.y, "P'", R1);
       proj= new Segment(Px.x,Px.y,M.x,M.y,"",R1);
       OPx= new Segment(O1.x,O1.y,M.x,0,"cos",R1);
       OPy= new Segment(O1.x,O1.y,0,M.y,"sin",R1);
       IM = new ArcDeCercle(0.0, 0.0, 1.0, 0.0, 1.0, "", R1);
       if(type==0){
           P = new pt(O1.x+1.0,M.y, "", R1);
           sfunctie = new sin();
           functie = new CourbeDeFonction(sfunctie, "", R1);;
       }
       else
       {
           P = new pt(O1.y + 1.0, M.y, "", R1);
           cfunctie = new cos();
           functie = new CourbeDeFonction(cfunctie, "", R1);
       }
       
       hline=new Droite(O1.x,O1.y,M.x,M.y,"",R1);
       if(use_end==1){
           endpoint2 = new point(end*pi2/360,0.0,"",R1);
           endpoint1 = new point(end*pi2/360,getSize().height,"",R1);
           Endpoint = new Vecteur(endpoint1,endpoint2, "end",R1);
       }
       Pcosx  = new point(P.x,0, "P''", R1);
       value= new Segment(P.x,P.y,P.x,0,"",R1);
    }

Here is the call graph for this function:

void sinus.mouseClicked ( MouseEvent  e) [inline]

Definition at line 301 of file sinus.java.

{ }
void sinus.mouseDragged ( MouseEvent  e) [inline]

Definition at line 259 of file sinus.java.

  { e.consume();
    M.bouge(e.getX(), e.getY());
    if(M.a * ap < 0.0){
       if(ap > 2.0){
           periodes ++ ;
       }
       else 
        {
           if(ap < -2.0){
              periodes -- ;
           }
       }
    }
    ap = M.a ;
    if(curve==1){
       absdegrees=Math.abs(degrees);
       if(absdegrees>180){scale=(absdegrees/180)*minscale;}
       R1.Repere(xz,yz, getSize().width, getSize().height,getSize().width/scale,getSize().width/scale);
    }
    O1.bouge(e.getX(), e.getY());
    repaint();
  }
void sinus.mouseEntered ( MouseEvent  e) [inline]

Definition at line 302 of file sinus.java.

{ }
void sinus.mouseExited ( MouseEvent  e) [inline]

Definition at line 303 of file sinus.java.

{ }
void sinus.mouseMoved ( MouseEvent  e) [inline]

Definition at line 289 of file sinus.java.

                                      {
    e.consume();
    if(modepaint == 1){ 
       if( M.zone(e.getX(), e.getY())){ 
           this.X = e.getX() + 2 ; this.Y = e.getY() + 2 ;
           M.deplace = false ;
       }
       Xret = e.getX(); Yret = e.getY();
       repaint();
    }
  }
void sinus.mousePressed ( MouseEvent  e) [inline]

Definition at line 244 of file sinus.java.

                                        {
    e.consume();
    if( M.zone(e.getX(), e.getY()) ){ 
       modepaint = 0 ;
       X = -1 ;
       repaint();
    }
    else
    {
       modepaint=2;
    }
  }
void sinus.mouseReleased ( MouseEvent  e) [inline]

Definition at line 283 of file sinus.java.

  { e.consume();
    M.deplace = O1.deplace = false ; modepaint = 1 ;
    repaint();
  }
void sinus.paint ( Graphics  g1) [inline]

Definition at line 167 of file sinus.java.

                                  {
       Font f = new Font("Arial", Font.PLAIN, 10);g.setFont(f);g.setColor(getBackground());g.fillRect(0, 0, R1.XMAX, R1.YMAX);
       double Ma = M.a + pi2 *(double)(periodes);degrees=Ma*(360/(pi2));double Maa = M.a ;aNp = Math.abs(periodes);
       if((M.a < 0.0) &&(periodes > 0)){ aNp -- ;Maa = Maa + pi2 ;} else { if((M.a > 0.0) &&(periodes < 0)){ aNp -- ;Maa = Maa - pi2 ;}}
       g.setColor(Color.gray);
       for(int i = 0 ; i < aNp ; i ++){ Cenr.Cercle(0.0, 0.0, 1.0 + R1.Abs(i + R1.X0));Cenr.trace(g); }
       IM.trace(g); IM.ArcDeCercle(0.0, 0.0, 1.0 + R1.Abs(aNp + R1.X0), 0.0, Maa);
       g.setColor(Color.gray);     xas.trace(g);yas.trace(g);
       g.setColor(Color.green);
       straal.Segment(O1,M);straal.trace(g);
       if(type==0){
           g.setColor(Color.red);
           Py.point(0,M.y);Py.trace(g);Py.traceNom(g);
           OPy.Segment(O1,Py);OPy.trace(g);
           proj.Segment(M,Py);proj.trace(g);
       }
       else
       {
           g.setColor(Color.red);
           Px.point(M.x,0);Px.trace(g);Px.traceNom(g);
           OPx.Segment(O1,Px);OPx.trace(g);
           g.setColor(Color.green);
           proj.Segment(M,Px);proj.trace(g);
       }
       if(curve==1){
           if(units==1 && aNp<10){
               g.setColor(Color.gray);
              if(use_degrees==1){
                  for(int i=1; i<(aNp+4);i++){
                     pp1=new point(i*pi2,0.0,(i*360)+"\u00B0",R1);
                      pp2=new point(-1.0*i*pi2,0.0,"-"+(i*360)+"\u00B0",R1);
                     pp1.trace(g);pp2.trace(g);      
                  }      
              }
              else
              {
                  for(int i=1; i<(aNp+4);i++){
                     pp1=new point(i*pi2,0.0,2*i+"\u03C0",R1);
                     pp2=new point(-1.0*i*pi2,0.0,"-"+2*i+"\u03C0",R1);
                     pp1.trace(g);pp2.trace(g);      
                  }
              }
           }
           g.setColor(Color.red);
           if(type==1){
              yP=(double) Math.cos(O1.x + Ma);
              P.point(O1.x + Ma, yP);
           }
           else
           {
              yP=(double) Math.sin(O1.x + Ma);
              P.point(O1.x + Ma, yP);
              hline.Droite(P,M);hline.trace(g);
           }
           Pcosx.point(P.x,0);Pcosx.trace(g);
           value.Segment(Pcosx,P);value.trace(g);
           if(use_end==1){g.setColor(Color.green);Endpoint.trace(g);}
           g.setColor(Color.orange);
           functie.trace(g);
       }
       g.setColor(Color.black);
       g.drawString(rem5,getSize().width/2,20);
       if(use_degrees==1){g.drawString(rem4+(double)(Math.round(10*degrees))/10 +"\u00B0",getSize().width/2, getSize().height - 30);}
       if(use_degrees==2){g.drawString(rem4+(double)(Math.round(1000*degrees/180))/1000 +rem3,getSize().width/2, getSize().height - 30);}
       if(absdegrees>180){g.drawString(rem2,getSize().width/2, getSize().height - 50);}
       C.trace(g);
       R1.cadre(g);
       P.trace(g);P.traceNom(g);
       if(modepaint==2){
           g.setColor(Color.red);
           g.drawString(rem1,getSize().width/2, getSize().height - 40);
       }
       if(modepaint==0){g.setColor(Color.red);}
       M.trace(g);
       g1.drawImage(img, 0, 0, this);
  }

Here is the caller graph for this function:

String sinus.ReadApplet ( ) [inline]

Definition at line 319 of file sinus.java.

                              {
       double radialen=(Math.round(100.0*degrees/180.0))/100.0;
       double deg=Math.round(degrees);
       String reply=degrees+","+rem4+radialen+rem3+","+rem4+deg+"\u00B0";
       return reply;
    }
void sinus.start ( ) [inline]

Definition at line 326 of file sinus.java.

{}

Here is the caller graph for this function:

void sinus.stop ( ) [inline]

Definition at line 327 of file sinus.java.

{}
void sinus.update ( Graphics  g1) [inline]

Definition at line 257 of file sinus.java.

{paint(g1);}

Here is the call graph for this function:


Member Data Documentation

double sinus.absdegrees = 0 [package]

Definition at line 82 of file sinus.java.

int sinus.aNp [package]

Definition at line 81 of file sinus.java.

double sinus.ap = 1.0 [package]

Definition at line 81 of file sinus.java.

Cercle sinus.C [package]

Definition at line 74 of file sinus.java.

Cercle sinus.Cenr [package]

Definition at line 74 of file sinus.java.

cos sinus.cfunctie [package]

Definition at line 80 of file sinus.java.

int sinus.curve = 1 [package]

Definition at line 83 of file sinus.java.

double sinus.degrees [package]

Definition at line 82 of file sinus.java.

double sinus.end = 0 [package]

Definition at line 82 of file sinus.java.

Vecteur sinus.Endpoint [package]

Definition at line 78 of file sinus.java.

pt sinus.endpoint1 [package]

Definition at line 72 of file sinus.java.

pt sinus.endpoint2 [package]

Definition at line 72 of file sinus.java.

CourbeDeFonction sinus.functie [package]

Definition at line 80 of file sinus.java.

Graphics sinus.g [package]

Definition at line 70 of file sinus.java.

Graphics sinus.g1 [package]

Definition at line 70 of file sinus.java.

Droite sinus.hline [package]

Definition at line 76 of file sinus.java.

ArcDeCercle sinus.IM [package]

Definition at line 75 of file sinus.java.

Image sinus.img [package]

Definition at line 70 of file sinus.java.

PointSurCercle sinus.M [package]

Definition at line 77 of file sinus.java.

double sinus.minscale = 7.0 [package]

Definition at line 83 of file sinus.java.

int sinus.modepaint = -1 [package]

Definition at line 81 of file sinus.java.

pt sinus.O [package]

Definition at line 72 of file sinus.java.

PointSurDroite sinus.O1 [package]

Definition at line 73 of file sinus.java.

Segment sinus.OPx [package]

Definition at line 79 of file sinus.java.

Segment sinus.OPy [package]

Definition at line 79 of file sinus.java.

pt sinus.P [package]

Definition at line 72 of file sinus.java.

pt sinus.Pcosx [package]

Definition at line 72 of file sinus.java.

int sinus.periodes = 0 [package]

Definition at line 81 of file sinus.java.

double sinus.pi2 [package]

Definition at line 81 of file sinus.java.

pt sinus.pp1 [package]

Definition at line 72 of file sinus.java.

pt sinus.pp2 [package]

Definition at line 72 of file sinus.java.

Segment sinus.proj [package]

Definition at line 79 of file sinus.java.

pt sinus.Px [package]

Definition at line 72 of file sinus.java.

pt sinus.Py [package]

Definition at line 72 of file sinus.java.

Repere sinus.R [package]

Definition at line 71 of file sinus.java.

Repere sinus.R1 [package]

Definition at line 71 of file sinus.java.

String sinus.rem1 = "Only point P [on the circle] can be rotated..." [package]

Definition at line 84 of file sinus.java.

String sinus.rem2 = "zooming out..." [package]

Definition at line 84 of file sinus.java.

String sinus.rem3 = "\u03C0 radians" [package]

Definition at line 84 of file sinus.java.

String sinus.rem4 = "the angle = " [package]

Definition at line 85 of file sinus.java.

String sinus.rem5 = " The unit circle" [package]

Definition at line 85 of file sinus.java.

double sinus.scale = 7.0 [package]

Definition at line 83 of file sinus.java.

sin sinus.sfunctie [package]

Definition at line 80 of file sinus.java.

double sinus.start = 0 [package]

Definition at line 82 of file sinus.java.

Segment sinus.straal [package]

Definition at line 79 of file sinus.java.

int sinus.type = 0 [package]

Definition at line 82 of file sinus.java.

int sinus.units = 1 [package]

Definition at line 83 of file sinus.java.

int sinus.use_degrees = 1 [package]

Definition at line 82 of file sinus.java.

int sinus.use_end = 0 [package]

Definition at line 83 of file sinus.java.

Segment sinus.value [package]

Definition at line 79 of file sinus.java.

int sinus.X [package]

Definition at line 81 of file sinus.java.

Droite sinus.xas [package]

Definition at line 76 of file sinus.java.

int sinus.Xret [package]

Definition at line 81 of file sinus.java.

int sinus.xz [package]

Definition at line 83 of file sinus.java.

int sinus.Y [package]

Definition at line 81 of file sinus.java.

Droite sinus.yas [package]

Definition at line 76 of file sinus.java.

double sinus.yP [package]

Definition at line 84 of file sinus.java.

int sinus.Yret [package]

Definition at line 81 of file sinus.java.

int sinus.yz [package]

Definition at line 83 of file sinus.java.


The documentation for this class was generated from the following file: