Back to index

wims  3.65+svn20090927
Static Public Member Functions
SketchEl.Util Class Reference

List of all members.

Static Public Member Functions

static void write (String S)
static void writeln (String S)
static void errmsg (String Title, String Text)
static String arrayStr (int[] A)
static String arrayStr (double[] A)
static String arrayStr (String[] A)
static String arrayStr (boolean[] A)
static int safeInt (String S, int Def)
static int safeInt (String S)
static double safeDouble (String S, double Def)
static double safeDouble (String S)
static int iround (double V)
static double sqr (double V)
static double norm2 (double x, double y)
static double norm2 (double x, double y, double z)
static double norm (double x, double y)
static double norm (double x, double y, double z)
static double angleDiff (double Th1, double Th2)
static boolean dblEqual (double d1, double d2)
static String colourHTML (int col)

Detailed Description

Definition at line 20 of file Util.java.


Member Function Documentation

static double SketchEl.Util.angleDiff ( double  Th1,
double  Th2 
) [inline, static]

Definition at line 61 of file Util.java.

    {
       double theta=Th1-Th2;
       return theta-(theta>Math.PI ? 2*Math.PI : 0)+(theta<-Math.PI ? 2*Math.PI : 0);
    }
static String SketchEl.Util.arrayStr ( int[]  A) [inline, static]

Definition at line 31 of file Util.java.

{String str=""; for (int n=0;n<A.length;n++) str+=(n>0 ? " " : "")+A[n]; return str;}
static String SketchEl.Util.arrayStr ( double[]  A) [inline, static]

Definition at line 32 of file Util.java.

{String str=""; for (int n=0;n<A.length;n++) str+=(n>0 ? " " : "")+A[n]; return str;}
static String SketchEl.Util.arrayStr ( String[]  A) [inline, static]

Definition at line 33 of file Util.java.

{String str=""; for (int n=0;n<A.length;n++) str+=(n>0 ? " " : "")+A[n]; return str;}
static String SketchEl.Util.arrayStr ( boolean[]  A) [inline, static]

Definition at line 34 of file Util.java.

{String str=""; for (int n=0;n<A.length;n++) str+=(n>0 ? " " : "")+A[n]; return str;}
static String SketchEl.Util.colourHTML ( int  col) [inline, static]

Definition at line 71 of file Util.java.

    {
       String str=Integer.toHexString(col);
       while (str.length()<6) str="0"+str;
       return "#"+str;
    }
static boolean SketchEl.Util.dblEqual ( double  d1,
double  d2 
) [inline, static]

Definition at line 68 of file Util.java.

{return Math.abs(d1-d2)<1E-10;}
static void SketchEl.Util.errmsg ( String  Title,
String  Text 
) [inline, static]

Definition at line 26 of file Util.java.

    {
       JOptionPane.showMessageDialog(null,Text,Title,JOptionPane.ERROR_MESSAGE);
    }
static int SketchEl.Util.iround ( double  V) [inline, static]

Definition at line 52 of file Util.java.

{return (int)Math.round(V);}
static double SketchEl.Util.norm ( double  x,
double  y 
) [inline, static]

Definition at line 57 of file Util.java.

{return Math.sqrt(x*x+y*y);}
static double SketchEl.Util.norm ( double  x,
double  y,
double  z 
) [inline, static]

Definition at line 58 of file Util.java.

{return Math.sqrt(x*x+y*y+z*z);}
static double SketchEl.Util.norm2 ( double  x,
double  y 
) [inline, static]

Definition at line 55 of file Util.java.

{return x*x+y*y;}
static double SketchEl.Util.norm2 ( double  x,
double  y,
double  z 
) [inline, static]

Definition at line 56 of file Util.java.

{return x*x+y*y+z*z;}
static double SketchEl.Util.safeDouble ( String  S,
double  Def 
) [inline, static]

Definition at line 44 of file Util.java.

    {
       if (S==null) return Def;
       try {return new Double(S).doubleValue();} 
       catch (NumberFormatException e) {return Def;}
    }
static double SketchEl.Util.safeDouble ( String  S) [inline, static]

Definition at line 50 of file Util.java.

{return safeDouble(S,0);}

Here is the call graph for this function:

Here is the caller graph for this function:

static int SketchEl.Util.safeInt ( String  S,
int  Def 
) [inline, static]

Definition at line 37 of file Util.java.

    {
       if (S==null) return Def;
       try {return new Integer(S).intValue();} 
       catch (NumberFormatException e) {return Def;}
    }
static int SketchEl.Util.safeInt ( String  S) [inline, static]

Definition at line 43 of file Util.java.

{return safeInt(S,0);}

Here is the call graph for this function:

Here is the caller graph for this function:

static double SketchEl.Util.sqr ( double  V) [inline, static]

Definition at line 54 of file Util.java.

{return V*V;}
static void SketchEl.Util.write ( String  S) [inline, static]

Definition at line 23 of file Util.java.

{System.out.print(S);}
static void SketchEl.Util.writeln ( String  S) [inline, static]

Definition at line 24 of file Util.java.

{System.out.println(S);}

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