示例#1
0
文件: Line.java 项目: inutard/cra
  // for interval lp-project
  public boolean similar(Line p) {
    double theta = Math.atan2(B.doubleValue(), A.doubleValue());
    double angle = theta >= 0 ? theta : 2 * Math.PI + theta;
    double ptheta = Math.atan2(p.B.doubleValue(), p.A.doubleValue());
    double pangle = ptheta >= 0 ? ptheta : 2 * Math.PI + ptheta;

    double norm = Math.sqrt(A.mult(A).add(B.mult(B)).doubleValue());
    double pnorm = Math.sqrt(p.A.mult(p.A).add(p.B.mult(p.B)).doubleValue());

    return (Math.abs(angle - pangle) < eps)
        && (Math.abs(C.doubleValue() / norm - p.C.doubleValue() / pnorm) < eps);
  }
示例#2
0
 public void doit() {
   A.foo();
   A.fred++;
   new Stat();
 }
示例#3
0
 public void access() {
   p.A a = this;
   a.m(); // compile time error
 }
 public void doit() {
   A.foo();
   A.fred++;
   double d = cos(0);
   new Stat();
 }
示例#5
0
 @EntryPoint
 public static void main(String args[]) {
   A.m();
 }
示例#6
0
 private void m() {
   /* [LCK06J,01,p.A.a */ synchronized (new Object()) {
     a.f = 5;
   } /* ] */
 }