summaryrefslogtreecommitdiff
path: root/Build/source/utils/asymptote/base/geometry.asy
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/utils/asymptote/base/geometry.asy')
-rw-r--r--Build/source/utils/asymptote/base/geometry.asy56
1 files changed, 25 insertions, 31 deletions
diff --git a/Build/source/utils/asymptote/base/geometry.asy b/Build/source/utils/asymptote/base/geometry.asy
index 12e35339dcc..0db3172d365 100644
--- a/Build/source/utils/asymptote/base/geometry.asy
+++ b/Build/source/utils/asymptote/base/geometry.asy
@@ -228,24 +228,6 @@ pair[] intersectionpoints(pair A, pair B, real[] equation)
// *=======================================================*
// *......................COORDINATES......................*
-// Copyright (c) 2007, Philippe Ivaldi.
-// Version: $Id: coordinates.asy,v 0.0 2007/02/03 16:06:23 Philippe Ivaldi Exp$
-// Last modified: Wed Aug 15 15:53:01 CEST 2007
-
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 3 of the License, or
-// any later version.
-
-// This program is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-// 02110-1301, USA.
real EPS=sqrt(realEpsilon);
@@ -492,8 +474,9 @@ bool samecoordsys(bool warn=true ... point[] M)
t=M[i].coordsys;
}
if(warn && !ret)
- write("Warning, the coordinate system of two objects are not the same.
-The operation will be done relatively to the default coordinate system.");
+ warning("coodinatesystem",
+ "the coordinate system of two objects are not the same.
+The operation will be done relative to the default coordinate system.");
return ret;
}
@@ -2418,8 +2401,10 @@ bool samecoordsys(bool warn=true ... bqe[] bqes)
t=bqes[i].coordsys;
}
if(warn && !ret)
- write("Warning, the coordinate system of two bivariate quadratic equations are not the same.
-The operation will be done relatively to the default coordinate system.");
+ warning("coodinatesystem",
+ "the coordinate system of two bivariate quadratic equations are not
+the same. The operation will be done relatively to the default coordinate
+system.");
return ret;
}
@@ -2710,7 +2695,9 @@ int circlenodesnumberfactor=100;/*<asyxml></code><documentation>Factor for the n
/*<asyxml><function type="int" signature="circlenodesnumber(real)"><code></asyxml>*/
int circlenodesnumber(real r)
{/*<asyxml></code><documentation>Return the number of nodes for drawing a circle of radius 'r'.</documentation></function></asyxml>*/
- if (circlenodesnumberfactor < 100) write("Warning: variable 'circlenodesnumberfactor' maybe too small.");
+ if (circlenodesnumberfactor < 100)
+ warning("circlenodesnumberfactor",
+ "variable 'circlenodesnumberfactor' may be too small.");
int oi=ceil(circlenodesnumberfactor*abs(r)^0.1);
oi=45*floor(oi/45);
return oi == 0 ? 4 : conicnodesfactor*oi;
@@ -2729,7 +2716,9 @@ int ellipsenodesnumberfactor=250;/*<asyxml></code><documentation>Factor for the
/*<asyxml><function type="int" signature="ellipsenodesnumber(real,real)"><code></asyxml>*/
int ellipsenodesnumber(real a, real b)
{/*<asyxml></code><documentation>Return the number of nodes to draw a ellipse of axis 'a' and 'b'.</documentation></function></asyxml>*/
- if (ellipsenodesnumberfactor < 250) write("Warning: variable 'ellipsenodesnumberfactor' maybe too small.");
+ if (ellipsenodesnumberfactor < 250)
+ write("ellipsenodesnumberfactor",
+ "variable 'ellipsenodesnumberfactor' maybe too small.");
int tmp=circlenodesnumberfactor;
circlenodesnumberfactor=ellipsenodesnumberfactor;
int oi=circlenodesnumber(max(abs(a),abs(b))/min(abs(a),abs(b)));
@@ -5481,7 +5470,7 @@ circle excircle(point A, point B, point C)
}
private int[] numarray={1,2,3};
-numarray.cyclic(true);
+numarray.cyclic=true;
/*<asyxml><struct signature="triangle"><code></asyxml>*/
struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/
@@ -6440,13 +6429,19 @@ point operator *(inversion i, point P)
return inverse(i.k,i.C,P);
}
+void lineinversion()
+{
+ warning("lineinversion","the inversion of the line is not a circle.
+The returned circle has an infinite radius, circle.l has been set.");
+}
+
+
/*<asyxml><function type="circle" signature="inverse(real,point,line)"><code></asyxml>*/
circle inverse(real k, point A, line l)
{/*<asyxml></code><documentation>Return the inverse circle of 'l' with
respect to point 'A' and inversion radius 'k'.</documentation></function></asyxml>*/
if(A @ l) {
- write("Warning: the inversion of the line is not a circle.");
- write("The returned circle has an infinite radius, cirlce.l have been set.");
+ lineinversion();
circle C=circle(A, infinity);
C.l=l;
return C;
@@ -6467,8 +6462,7 @@ circle inverse(real k, point A, circle c)
respect to point A and inversion radius 'k'.</documentation></function></asyxml>*/
if(degenerate(c)) return inverse(k,A,c.l);
if(A @ c) {
- write("Warning: the inversion of the circle is not a circle.");
- write("The returned circle has an infinite radius, cirlce.l have been set.");
+ lineinversion();
point M=rotate(180,c.C)*A, Mp=rotate(90,c.C)*A;
circle oc=circle(A,infinity);
oc.l=line(inverse(k,A,M),inverse(k,A,Mp));
@@ -7123,7 +7117,7 @@ path square(pair z1, pair z2)
// relative to the path z--z+dir.
void perpendicular(picture pic=currentpicture, pair z, pair align,
pair dir=E, real size=0, pen p=currentpen,
- margin margin=NoMargin, filltype filltype=NoFill)
+ margin margin=NoMargin, filltype filltype=NoFill)
{
perpendicularmark(pic,(point) z,align,dir,size,p,margin,filltype);
}
@@ -7133,7 +7127,7 @@ void perpendicular(picture pic=currentpicture, pair z, pair align,
// relative to the path z--z+dir(g,0)
void perpendicular(picture pic=currentpicture, pair z, pair align, path g,
real size=0, pen p=currentpen, margin margin=NoMargin,
- filltype filltype=NoFill)
+ filltype filltype=NoFill)
{
perpendicularmark(pic,(point) z,align,dir(g,0),size,p,margin,filltype);
}