File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
src/main/java/one/empty3/apps/opad Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,18 @@ public Lines(Path path) {
4343 this .path = path ;
4444 }
4545
46-
46+ remainder (double t , double n ) {
47+ double sign = Math .sign (t *n );
48+ if (sign ! =0 ) {
49+ double N = Math . abs (n ) ;
50+ double T = Math . abs (t );
51+ double r =T /N -((int )) T *N ) /((int ) N ) ;
52+
53+
54+ return r ;
55+ }
56+ return n ==0 ?Double .Nan :0 ;
57+ }
4758 @ Override
4859 public Point3D calculerPoint3D (double t ) {
4960 try {
@@ -52,7 +63,7 @@ public Point3D calculerPoint3D(double t) {
5263 if (path .size () >= 2 ) {
5364 LineSegment segmentDroite = new LineSegment (path .get (segm ), path .get (segm + 1 ));
5465
55- double v = Math . IEEEremainder (t * path .size (), segm );
66+ double v = remainder (t * path .size (), segm );
5667
5768 return segmentDroite .calculerPoint3D (v );
5869 } else
You can’t perform that action at this time.
0 commit comments