| r0,r1); |
r0,r1); |
| return ret; |
return ret; |
| } |
} |
| |
public Outline[] fitSample(Outline[] sample,Point p0, Point p1,double ratio){ |
| |
Point p2=sample[0].firstPoint(); |
| |
Point p3=sample[0].lastPoint(); |
| |
double theta1=p3.minus(p2).theta(); |
| |
double theta2=p1.minus(p0).theta(); |
| |
double len01=p0.distance(p1),len23=p2.distance(p3); |
| |
double r1=len01/len23; |
| |
Outline[] ret=new Outline[2]; |
| |
ret[0]=sample[0].plus(p2.neg()).rot(-theta1).times(r1).timesY(ratio).rot(theta2).plus(p0); |
| |
ret[1]=sample[1].plus(p2.neg()).rot(-theta1).times(r1).timesY(ratio).rot(theta2).plus(p0); |
| |
return ret; |
| |
} |
| } |
} |
| |
|
| |
|
| |
|
| |
|