summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2012-05-31 23:08:27 +0000
committerKarl Berry <karl@freefriends.org>2012-05-31 23:08:27 +0000
commit43302e4235ec0431ecd3365616212c18892d6187 (patch)
tree265e5d6b8af761d19b3ad3cfc6de4a36696c8857 /Master
parent359f8fc550d95dcb9c5cae523b0f28a117ca4996 (diff)
asymptote 2.16
git-svn-id: svn://tug.org/texlive/trunk@26747 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/bin/alpha-linux/asybin5008624 -> 4751784 bytes
-rwxr-xr-xMaster/bin/i386-cygwin/asy.exebin6167054 -> 3788302 bytes
-rwxr-xr-xMaster/bin/i386-cygwin/freeglut.dllbin197632 -> 0 bytes
-rwxr-xr-xMaster/bin/i386-linux/asybin4244884 -> 4077404 bytes
-rwxr-xr-xMaster/bin/powerpc-linux/asybin3839324 -> 3714152 bytes
-rwxr-xr-xMaster/texmf/asymptote/GUI/xasy2asy.py111
-rwxr-xr-xMaster/texmf/asymptote/GUI/xasyMainWin.py4
-rwxr-xr-xMaster/texmf/asymptote/GUI/xasyOptionsDialog.py17
-rwxr-xr-xMaster/texmf/asymptote/GUI/xasyVersion.py2
-rw-r--r--Master/texmf/asymptote/asy-keywords.el6
-rw-r--r--Master/texmf/asymptote/geometry.asy1518
-rw-r--r--Master/texmf/asymptote/graph.asy56
-rw-r--r--Master/texmf/asymptote/graph3.asy113
-rw-r--r--Master/texmf/asymptote/palette.asy12
-rw-r--r--Master/texmf/asymptote/plain_Label.asy17
-rw-r--r--Master/texmf/asymptote/plain_bounds.asy32
-rw-r--r--Master/texmf/asymptote/plain_constants.asy8
-rw-r--r--Master/texmf/asymptote/plain_markers.asy45
-rw-r--r--Master/texmf/asymptote/plain_paths.asy4
-rw-r--r--Master/texmf/asymptote/plain_strings.asy8
-rw-r--r--Master/texmf/asymptote/solids.asy70
-rw-r--r--Master/texmf/asymptote/three.asy19
-rw-r--r--Master/texmf/asymptote/three_arrows.asy68
-rw-r--r--Master/texmf/asymptote/three_surface.asy241
-rw-r--r--Master/texmf/asymptote/version.asy2
-rw-r--r--Master/texmf/doc/asymptote/CAD.pdfbin67539 -> 67553 bytes
-rw-r--r--Master/texmf/doc/asymptote/TeXShopAndAsymptote.pdfbin31404 -> 31448 bytes
-rw-r--r--Master/texmf/doc/asymptote/asy-latex.pdfbin207758 -> 194336 bytes
-rw-r--r--Master/texmf/doc/asymptote/asyRefCard.pdfbin0 -> 47440 bytes
-rw-r--r--Master/texmf/doc/asymptote/asymptote.pdfbin1758774 -> 1234515 bytes
-rw-r--r--Master/texmf/doc/asymptote/examples/animations/earthmoon.asy2
-rw-r--r--Master/texmf/doc/asymptote/examples/animations/sphere.asy6
-rw-r--r--Master/texmf/doc/asymptote/examples/animations/wheel.asy16
-rw-r--r--Master/texmf/doc/asymptote/examples/electromagnetic.asy12
-rw-r--r--Master/texmf/doc/asymptote/examples/hyperboloid.asy4
-rw-r--r--Master/texmf/doc/asymptote/examples/hyperboloidsilhouette.asy4
-rw-r--r--Master/texmf/doc/asymptote/examples/latexusage.tex2
-rw-r--r--Master/texmf/doc/asymptote/examples/pseudosphere.asy33
-rw-r--r--Master/texmf/doc/asymptote/examples/ring.asy1
-rw-r--r--Master/texmf/doc/asymptote/examples/splitpatch.asy69
-rw-r--r--Master/texmf/doc/info/asy-faq.info2
-rw-r--r--Master/texmf/doc/info/asymptote.info1050
-rw-r--r--Master/texmf/doc/man/man1/asy.man1.pdfbin11380 -> 11391 bytes
-rw-r--r--Master/texmf/doc/man/man1/xasy.man1.pdfbin3837 -> 3859 bytes
-rw-r--r--Master/texmf/tex/latex/asymptote/asymptote.sty32
-rwxr-xr-xMaster/tlpkg/asymptote/asy.exebin6167054 -> 6258176 bytes
46 files changed, 1897 insertions, 1689 deletions
diff --git a/Master/bin/alpha-linux/asy b/Master/bin/alpha-linux/asy
index fb2bc94cb4d..ef5231eda7d 100755
--- a/Master/bin/alpha-linux/asy
+++ b/Master/bin/alpha-linux/asy
Binary files differ
diff --git a/Master/bin/i386-cygwin/asy.exe b/Master/bin/i386-cygwin/asy.exe
index 3afb7314158..fd7a16e5db9 100755
--- a/Master/bin/i386-cygwin/asy.exe
+++ b/Master/bin/i386-cygwin/asy.exe
Binary files differ
diff --git a/Master/bin/i386-cygwin/freeglut.dll b/Master/bin/i386-cygwin/freeglut.dll
deleted file mode 100755
index 9a98cf1fb1e..00000000000
--- a/Master/bin/i386-cygwin/freeglut.dll
+++ /dev/null
Binary files differ
diff --git a/Master/bin/i386-linux/asy b/Master/bin/i386-linux/asy
index 4dd4d0ac25b..a4098da63ad 100755
--- a/Master/bin/i386-linux/asy
+++ b/Master/bin/i386-linux/asy
Binary files differ
diff --git a/Master/bin/powerpc-linux/asy b/Master/bin/powerpc-linux/asy
index aacfcf9abaf..0229ba9ed97 100755
--- a/Master/bin/powerpc-linux/asy
+++ b/Master/bin/powerpc-linux/asy
Binary files differ
diff --git a/Master/texmf/asymptote/GUI/xasy2asy.py b/Master/texmf/asymptote/GUI/xasy2asy.py
index a86a1e732d1..7779e073f81 100755
--- a/Master/texmf/asymptote/GUI/xasy2asy.py
+++ b/Master/texmf/asymptote/GUI/xasy2asy.py
@@ -25,13 +25,6 @@ except:
import CubicBezier
-class asyProcessFailure(Exception):
- """asy could not be invoked to execute a command because the process has failed."""
- pass
-
-idCounter = 0;
-randString = 'wGd3I26kOcu4ZI4arZZMqoJufO2h1QE2D728f1Lai3aqeTQC9'
-
quickAsyFailed = True
global AsyTempDir
@@ -41,10 +34,11 @@ def startQuickAsy():
global quickAsy
global quickAsyFailed
global AsyTempDir
+ global fout,fin
if quickAsyRunning():
return
try:
- quickAsy.stdin.close()
+ fout.close()
quickAsy.wait()
except:
pass
@@ -54,9 +48,18 @@ def startQuickAsy():
AsyTempDir=mkdtemp(prefix="asy_", dir="./")
else:
AsyTempDir=mkdtemp(prefix="asy_")+os.sep
- quickAsy = Popen([xasyOptions.options['asyPath'],"-noV","-multiline",
- "-interactive","-o"+AsyTempDir],
- stdin=PIPE,stdout=PIPE,stderr=STDOUT)
+ if sys.platform[:3] == 'win':
+ quickAsy=Popen([xasyOptions.options['asyPath'],"-noV","-multiline","-q",
+ "-o"+AsyTempDir,"-inpipe=0","-outpipe=2"],stdin=PIPE,stderr=PIPE)
+ fout=quickAsy.stdin
+ fin=quickAsy.stderr
+ else:
+ (rx,wx) = os.pipe()
+ (ra,wa) = os.pipe()
+ quickAsy=Popen([xasyOptions.options['asyPath'],"-noV","-multiline","-q",
+ "-o"+AsyTempDir,"-inpipe="+str(rx),"-outpipe="+str(wa)])
+ fout=os.fdopen(wx,'w')
+ fin=os.fdopen(ra,'r')
if quickAsy.returncode != None:
quickAsyFailed = True
except:
@@ -74,8 +77,7 @@ def quickAsyRunning():
def asyExecute(command):
if not quickAsyRunning():
startQuickAsy()
- syncQuickAsyOutput()
- quickAsy.stdin.write(command)
+ fout.write(command)
def closeConsole(event):
global console
@@ -96,19 +98,6 @@ def consoleOutput(line):
console.insert(END,line)
ctl.lift()
-def syncQuickAsyOutput(verbose=False,queue=None):
- global idCounter
- idStr = randString+"-id "+str(idCounter)
- idCounter += 1
- quickAsy.stdin.write("\nwrite(\""+idStr+"\");\n")
- quickAsy.stdin.flush()
- line = quickAsy.stdout.readline()
- while not line.endswith(idStr+'\n'):
- if verbose:
- queue.put(("OUTPUT",line))
- line = quickAsy.stdout.readline()
- quickAsy.stdin.flush()
-
class asyTransform:
"""A python implementation of an asy transform"""
def __init__(self,initTuple,delete=False):
@@ -128,7 +117,6 @@ class asyTransform:
return str(self.t)
def scale(self,s):
- #return asyTransform((s*self.t[0],s*self.t[1],s*self.t[2],s*self.t[3],s*self.t[4],s*self.t[5]))
return asyTransform((0,0,s,0,0,s))*self
def __str__(self):
@@ -208,30 +196,27 @@ class asyPen(asyObj):
def computeColor(self):
"""Find out the color of an arbitrary asymptote pen."""
- syncQuickAsyOutput()
- quickAsy.stdin.write("pen p="+self.getCode()+';\n')
- quickAsy.stdin.write("write(\";\n\");write(colorspace(p));\n")
- quickAsy.stdin.write("write(colors(p));\n")
- quickAsy.stdin.flush()
- testline = quickAsy.stdout.readline()
- if testline.startswith("> -:"):
- raise Exception,"Invalid pen options"
- quickAsy.stdout.readline()
- colorspace = quickAsy.stdout.readline()
+ fout.write("pen p="+self.getCode()+';\n')
+ fout.write("file fout=output(mode='pipe');\n")
+ fout.write("write(fout,colorspace(p),newl);\n")
+ fout.write("write(fout,colors(p));\n")
+ fout.write("flush(fout);\n")
+ fout.flush()
+ colorspace = fin.readline()
if colorspace.find("cmyk") != -1:
- lines = quickAsy.stdout.readline()+quickAsy.stdout.readline()+quickAsy.stdout.readline()+quickAsy.stdout.readline()
+ lines = fin.readline()+fin.readline()+fin.readline()+fin.readline()
parts = lines.split()
- c,m,y,k = eval(parts[2]),eval(parts[4]),eval(parts[6]),eval(parts[8])
+ c,m,y,k = eval(parts[0]),eval(parts[1]),eval(parts[2]),eval(parts[3])
k = 1-k
r,g,b = ((1-c)*k,(1-m)*k,(1-y)*k)
elif colorspace.find("rgb") != -1:
- lines = quickAsy.stdout.readline()+quickAsy.stdout.readline()+quickAsy.stdout.readline()
+ lines = fin.readline()+fin.readline()+fin.readline()
parts = lines.split()
- r,g,b = eval(parts[2]),eval(parts[4]),eval(parts[6])
+ r,g,b = eval(parts[0]),eval(parts[1]),eval(parts[2])
elif colorspace.find("gray") != -1:
- lines = quickAsy.stdout.readline()
+ lines = fin.readline()
parts = lines.split()
- r = g = b = eval(parts[2])
+ r = g = b = eval(parts[0])
self.color = (r,g,b)
def tkColor(self):
@@ -352,18 +337,19 @@ class asyPath(asyObj):
def computeControls(self):
"""Evaluate the code of the path to obtain its control points"""
- syncQuickAsyOutput()
- quickAsy.stdin.write("path p="+self.getCode()+';\n')
- quickAsy.stdin.write("write(length(p));\n")
- quickAsy.stdin.write("write(unstraighten(p));write(\"\");\n")
- quickAsy.stdin.flush()
- lengthStr = quickAsy.stdout.readline()
+ fout.write("file fout=output(mode='pipe');\n")
+ fout.write("path p="+self.getCode()+';\n')
+ fout.write("write(fout,length(p),newl);\n")
+ fout.write("write(fout,unstraighten(p),endl);\n")
+ fout.flush()
+ lengthStr = fin.readline()
pathSegments = eval(lengthStr.split()[-1])
pathStrLines = []
for i in range(pathSegments+1):
- pathStrLines.append(quickAsy.stdout.readline())
+ line=fin.readline()
+ line=line.replace("\n","")
+ pathStrLines.append(line)
oneLiner = "".join(split(join(pathStrLines)))
- oneLiner = oneLiner.replace(">","")
splitList = oneLiner.split("..")
nodes = [a for a in splitList if a.find("controls")==-1]
self.nodeSet = []
@@ -468,23 +454,20 @@ class xasyItem:
def asyfyThread(self,mag=1.0):
"""Convert the item to a list of images by deconstructing this item's code"""
- quickAsy.stdin.write("\nreset;\n")
- quickAsy.stdin.write("initXasyMode();\n")
- quickAsy.stdin.write("atexit(null);\n")
- syncQuickAsyOutput()
+ fout.write("reset;\n")
+ fout.write("initXasyMode();\n")
+ fout.write("atexit(null);\n")
global console
for line in self.getCode().splitlines():
- quickAsy.stdin.write(line+"\n");
- quickAsy.stdin.flush()
- syncQuickAsyOutput(verbose=True,queue=self.imageHandleQueue);
- quickAsy.stdin.write("deconstruct(%f);\n"%mag)
- quickAsy.stdin.flush()
+ fout.write(line+"\n");
+ fout.write("deconstruct(%f);\n"%mag)
+ fout.flush()
format = "png"
- maxargs = int(split(quickAsy.stdout.readline())[1])
+ maxargs = int(split(fin.readline())[0])
boxes=[]
batch=0
n=0
- text = quickAsy.stdout.readline()
+ text = fin.readline()
template=AsyTempDir+"%d_%d.%s"
def render():
for i in range(len(boxes)):
@@ -493,7 +476,7 @@ class xasyItem:
self.imageHandleQueue.put((name,format,(l,b,r,t),i))
while text != "Done\n" and text != "Error\n":
boxes.append(text)
- text = quickAsy.stdout.readline()
+ text = fin.readline()
n += 1
if n >= maxargs:
render()
@@ -501,7 +484,7 @@ class xasyItem:
batch += 1
n=0
if text == "Error\n":
- self.imageHandleQueue.put(("ERROR",quickAsy.stdout.readline()))
+ self.imageHandleQueue.put(("ERROR",fin.readline()))
else:
render()
self.imageHandleQueue.put((None,))
diff --git a/Master/texmf/asymptote/GUI/xasyMainWin.py b/Master/texmf/asymptote/GUI/xasyMainWin.py
index 2876d014a56..0967107ac1a 100755
--- a/Master/texmf/asymptote/GUI/xasyMainWin.py
+++ b/Master/texmf/asymptote/GUI/xasyMainWin.py
@@ -57,7 +57,7 @@ class xasyMainWin:
self.createWidgets()
self.resetGUI()
if sys.platform[:3] == "win":
- site="http://effbot.org/downloads/PIL-1.1.7.win32-py2.6.exe"
+ site="http://effbot.org/downloads/PIL-1.1.7.win32-py2.7.exe"
else:
site="http://effbot.org/downloads/Imaging-1.1.7.tar.gz"
if not PILAvailable:
@@ -781,7 +781,7 @@ class xasyMainWin:
def helpAsyDocCmd(self):
#print "Open documentation about Asymptote"
- asyExecute("\nhelp;\n")
+ asyExecute("help;\n")
def helpAboutCmd(self):
tkMessageBox.showinfo("About xasy","A graphical interface for Asymptote "+xasyVersion)
diff --git a/Master/texmf/asymptote/GUI/xasyOptionsDialog.py b/Master/texmf/asymptote/GUI/xasyOptionsDialog.py
index b93b2a7fed9..c3162e8673b 100755
--- a/Master/texmf/asymptote/GUI/xasyOptionsDialog.py
+++ b/Master/texmf/asymptote/GUI/xasyOptionsDialog.py
@@ -18,7 +18,6 @@ import tkMessageBox
import tkFileDialog
import tkColorChooser
import os
-import subprocess
import sys
class xasyOptionsDlg(tkSimpleDialog.Dialog):
@@ -181,22 +180,6 @@ class xasyOptionsDlg(tkSimpleDialog.Dialog):
def validate(self):
"""Validate the data entered into the dialog"""
- #validate the path
- pathOK = True
- try:
- test = subprocess.Popen([self.ap.get(),"-interactive"],stdin=subprocess.PIPE,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
- test.stdin.close()
- test.wait()
- idString = test.stdout.read()
- except:
- pathOK = False
- if not pathOK or not idString.startswith("Welcome to Asymptote"):
- tkMessageBox.showerror("xasy Options","Specified file does not exist or is not an Asymptote executable.\r\n"+self.ap.get(),parent=self)
- return False
-
- #validate the external editor
- # how can I validate the editor?
-
#validate the color
hexdigits = '0123456789abcdef'
if not self.validateAColor(self.pc):
diff --git a/Master/texmf/asymptote/GUI/xasyVersion.py b/Master/texmf/asymptote/GUI/xasyVersion.py
index d8fcc6139ec..7349b08d046 100755
--- a/Master/texmf/asymptote/GUI/xasyVersion.py
+++ b/Master/texmf/asymptote/GUI/xasyVersion.py
@@ -1,2 +1,2 @@
#!/usr/bin/env python
-xasyVersion = "2.13"
+xasyVersion = "2.16"
diff --git a/Master/texmf/asymptote/asy-keywords.el b/Master/texmf/asymptote/asy-keywords.el
index d004bc7e9b3..0bb5b66e7ab 100644
--- a/Master/texmf/asymptote/asy-keywords.el
+++ b/Master/texmf/asymptote/asy-keywords.el
@@ -2,7 +2,7 @@
;; This file is automatically generated by asy-list.pl.
;; Changes will be overwritten.
;;
-(defvar asy-keywords-version "2.13")
+(defvar asy-keywords-version "2.16")
(defvar asy-keyword-name '(
and controls tension atleast curl if else while for do return break continue struct typedef new access import unravel from include quote static public private restricted this explicit true false null cycle newframe operator ))
@@ -11,7 +11,7 @@ and controls tension atleast curl if else while for do return break continue str
Braid FitResult Label Legend Segment Solution TreeNode abscissa arc arrowhead binarytree binarytreeNode block bool bool3 bounds bqe circle conic coord coordsys cputime ellipse file filltype frame grid3 guide horner hsv hyperbola indexedTransform int inversion key light line linefit marginT marker mass object pair parabola path path3 pen picture point position projection real revolution scaleT scientific segment side slice solution splitface string surface tensionSpecifier ticklocate ticksgridT tickvalues transform transformation tree triangle trilinear triple vector vertex void ))
(defvar asy-function-name '(
-AND Arc ArcArrow ArcArrows Arrow Arrows Automatic AvantGarde BBox BWRainbow BWRainbow2 Bar Bars BeginArcArrow BeginArrow BeginBar BeginDotMargin BeginMargin BeginPenMargin Blank Bookman Bottom BottomTop Bounds Break Broken BrokenLog CLZ CTZ Ceil Circle CircleBarIntervalMarker Cos Courier CrossIntervalMarker DOSendl DOSnewl DefaultFormat DefaultLogFormat Degrees Dir DotMargin DotMargins Dotted Draw Drawline Embed EndArcArrow EndArrow EndBar EndDotMargin EndMargin EndPenMargin Fill FillDraw Floor Format Full Gaussian Gaussrand Gaussrandpair Gradient Grayscale Helvetica Hermite HookHead InOutTicks InTicks Jn Label Landscape Left LeftRight LeftTicks Legend Linear Link Log LogFormat Margin Margins Mark MidArcArrow MidArrow NOT NewCenturySchoolBook NoBox NoMargin NoModifier NoTicks NoTicks3 NoZero NoZeroFormat None OR OmitFormat OmitTick OmitTickInterval OmitTickIntervals OutTicks Ox Oy Palatino PaletteTicks Pen PenMargin PenMargins Pentype Portrait RadialShade RadialShadeDraw Rainbow Range Relative Right RightTicks Rotate Round SQR Scale ScaleX ScaleY ScaleZ Seascape Segment Shift Sin Slant Spline StickIntervalMarker Straight Symbol Tan TeXify Ticks Ticks3 TildeIntervalMarker TimesRoman Top TrueMargin UnFill UpsideDown Wheel X XEquals XOR XY XYEquals XYZero XYgrid XZEquals XZZero XZero XZgrid Y YEquals YXgrid YZ YZEquals YZZero YZero YZgrid Yn Z ZX ZXgrid ZYgrid ZapfChancery ZapfDingbats _begingroup3 _cputime _draw _eval _image _labelpath _projection _strokepath _texpath aCos aSin aTan abort abs accel acos acosh acot acsc activatequote add addArrow addMargins addSaveFunction addpenarc addpenline adjust alias align all altitude angabscissa angle angpoint animate annotate anticomplementary antipedal apply approximate arc arcarrowsize arccircle arcdir arcfromcenter arcfromfocus arclength arcnodesnumber arcpoint arcsubtended arcsubtendedcenter arctime arctopath array arrow arrow2 arrowbase arrowbasepoints arrowsize asec asin asinh ask assert asy asycode asydir asyfigure asyfilecode asyinclude asywrite atan atan2 atanh atbreakpoint atexit attach attract atupdate autoformat autoscale autoscale3 axes axes3 axialshade axis axiscoverage azimuth babel background bangles bar barmarksize barsize basealign baseline bbox beep begin beginclip begingroup beginpoint between bevel bezier bezierP bezierPP bezierPPP bezulate bibliography bibliographystyle binarytree binarytreeNode binomial binput bins bisector bisectorpoint bispline blend blockconnector boutput box bqe breakpoint breakpoints brick buildRestoreDefaults buildRestoreThunk buildcycle bulletcolor byte calculateScaling canonical canonicalcartesiansystem cartesiansystem case1 case2 case3 case4 cbrt cd ceil center centerToFocus centroid cevian change2 changecoordsys checkSegment checkconditionlength checker checkincreasing checklengths checkposition checktriangle choose circle circlebarframe circlemarkradius circlenodesnumber circumcenter circumcircle clamped clear clip clipdraw close cmyk code colatitude collect collinear color colorless colors colorspace comma compassmark complement complementary concat concurrent cone conic conicnodesnumber conictype conj connect connected connectedindex containmentTree contains contour contour3 contouredges controlSpecifier convert coordinates coordsys copy copyPairOrTriple cos cosh cot countIntersections cputime crop cropcode cross crossframe crosshatch crossmarksize csc cubicroots curabscissa curlSpecifier curpoint currentarrow currentexitfunction currentmomarrow currentpolarconicroutine curve cut cutafter cutbefore cyclic cylinder deactivatequote debugger deconstruct defaultdir defaultformat defaultpen defined degenerate degrees delete deletepreamble determinant diagonal diamond diffdiv dir dirSpecifier dirtime display distance divisors do_overpaint dot dotframe dotsize downcase draw drawAll drawDoubleLine drawFermion drawGhost drawGluon drawMomArrow drawPRCcylinder drawPRCdisk drawPRCsphere drawPRCtube drawPhoton drawScalar drawVertex drawVertexBox drawVertexBoxO drawVertexBoxX drawVertexO drawVertexOX drawVertexTriangle drawVertexTriangleO drawVertexX drawarrow drawarrow2 drawline drawpixel drawtick duplicate elle ellipse ellipsenodesnumber embed embed3 empty enclose end endScript endclip endgroup endgroup3 endl endpoint endpoints eof eol equation equations erase erasestep erf erfc error errorbar errorbars eval excenter excircle exit exitXasyMode exitfunction exp expfactors expi expm1 exradius extend extension extouch fabs factorial fermat fft fhorner figure file filecode fill filldraw filloutside fillrule filltype find finite finiteDifferenceJacobian firstcut firstframe fit fit2 fixedscaling floor flush fmdefaults fmod focusToCenter font fontcommand fontsize foot format frac frequency fromCenter fromFocus fspline functionshade gamma generate_random_backtrace generateticks gergonne getc getint getpair getreal getstring gettriple gluon gouraudshade graph graphic gray grestore grid grid3 gsave halfbox hatch hdiffdiv hermite hex histogram history hline hprojection hsv hyperbola hyperbolanodesnumber hyperlink hypot identity image incenter incentral incircle increasing incrementposition indexedTransform indexedfigure initXasyMode initdefaults input inradius insert inside integrate interactive interior interp interpolate intersect intersection intersectionpoint intersectionpoints intersections intouch inverse inversion invisible is3D isCCW isDuplicate isogonal isogonalconjugate isotomic isotomicconjugate isparabola italic item jobname key kurtosis kurtosisexcess label labelaxis labelmargin labelpath labels labeltick labelx labelx3 labely labely3 labelz labelz3 lastcut latex latitude latticeshade layer layout ldexp leastsquares legend legenditem length lexorder lift light limits line linear linecap lineinversion linejoin linemargin lineskip linetype linewidth link list lm_enorm lm_evaluate_default lm_lmdif lm_lmpar lm_minimize lm_print_default lm_print_quiet lm_qrfac lm_qrsolv locale locate locatefile location log log10 log1p logaxiscoverage longitude lookup makeNode makedraw makepen map margin markangle markangleradius markanglespace markarc marker markinterval marknodes markrightangle markuniform mass masscenter massformat math max max3 maxAfterTransform maxbezier maxbound maxcoords maxlength maxratio maxtimes mean medial median midpoint min min3 minAfterTransform minbezier minbound minipage minratio mintimes miterlimit mktemp momArrowPath momarrowsize monotonic multifigure nativeformat natural needshipout newl newpage newslide newton newtree nextframe nextnormal nextpage nib nodabscissa none norm normalvideo notaknot nowarn numberpage nurb object offset onpath opacity opposite orientation origin orthic orthocentercenter outformat outline outname outprefix output overloadedMessage overwrite pack pad pairs palette parabola parabolanodesnumber parallel parallelogram partialsum path path3 pattern pause pdf pedal periodic perp perpendicular perpendicularmark phantom phi1 phi2 phi3 photon piecewisestraight point polar polarconicroutine polargraph polygon postcontrol postscript pow10 ppoint prc prc0 precision precontrol prepend printBytecode print_random_addresses project projection purge pwhermite quadrant quadraticroots quantize quarticroots quotient radialshade radians radicalcenter radicalline radius rand randompath rd readline realmult realquarticroots rectangle rectangular rectify reflect relabscissa relative relativedistance reldir relpoint reltime remainder remark removeDuplicates rename replace report resetdefaultpen restore restoredefaults reverse reversevideo rf rfind rgb rgba rgbint rms rotate rotateO rotation round roundbox roundedpath roundrectangle same samecoordsys sameside sample save savedefaults saveline scale scale3 scaleO scaleT scaleless scientific search searchindex searchtree sec secondaryX secondaryY seconds section sector seek seekeof segment sequence setcontour setpens sgn sgnd sharpangle sharpdegrees shift shiftless shipout shipout3 show side simeq simpson sin sinh size size3 skewness skip slant sleep slope slopefield solve solveBVP sort sourceline sphere split sqrt square srand standardizecoordsys startScript stdev step stickframe stickmarksize stickmarkspace stop straight straightness string stripdirectory stripextension stripfile stripsuffix strokepath subdivide subitem subpath substr sum surface symmedial symmedian system tab tableau tan tangent tangential tangents tanh tell tensionSpecifier tensorshade tex texcolor texify texpath texpreamble texreset texshipout texsize textpath thick thin tick tickMax tickMax3 tickMin tickMin3 ticklabelshift ticklocate tildeframe tildemarksize tile tiling time times title titlepage topbox transform transformation transpose trembleFuzz triangle triangleAbc triangleabc triangulate tricoef tridiagonal trilinear trim truepoint tube uncycle unfill uniform unique unit unitrand unitsize unityroot unstraighten upcase updatefunction uperiodic upscale uptodate usepackage usersetting usetypescript usleep value variance variancebiased vbox vector vectorfield verbatim view vline vperiodic vprojection warn warning windingnumber write xaxis xaxis3 xaxis3At xaxisAt xequals xinput xlimits xoutput xpart xscale xscaleO xtick xtick3 xtrans yaxis yaxis3 yaxis3At yaxisAt yequals ylimits ypart yscale yscaleO ytick ytick3 ytrans zaxis3 zaxis3At zero zero3 zlimits zpart ztick ztick3 ztrans ))
+AND Arc ArcArrow ArcArrows Arrow Arrows Automatic AvantGarde BBox BWRainbow BWRainbow2 Bar Bars BeginArcArrow BeginArrow BeginBar BeginDotMargin BeginMargin BeginPenMargin Blank Bookman Bottom BottomTop Bounds Break Broken BrokenLog CLZ CTZ Ceil Circle CircleBarIntervalMarker Cos Courier CrossIntervalMarker DOSendl DOSnewl DefaultFormat DefaultLogFormat Degrees Dir DotMargin DotMargins Dotted Draw Drawline Embed EndArcArrow EndArrow EndBar EndDotMargin EndMargin EndPenMargin Fill FillDraw Floor Format Full Gaussian Gaussrand Gaussrandpair Gradient Grayscale Helvetica Hermite HookHead InOutTicks InTicks Jn Label Landscape Left LeftRight LeftTicks Legend Linear Link Log LogFormat Margin Margins Mark MidArcArrow MidArrow NOT NewCenturySchoolBook NoBox NoMargin NoModifier NoTicks NoTicks3 NoZero NoZeroFormat None OR OmitFormat OmitTick OmitTickInterval OmitTickIntervals OutTicks Ox Oy Palatino PaletteTicks Pen PenMargin PenMargins Pentype Portrait RadialShade RadialShadeDraw Rainbow Range Relative Right RightTicks Rotate Round SQR Scale ScaleX ScaleY ScaleZ Seascape Segment Shift Sin Slant Spline StickIntervalMarker Straight Symbol Tan TeXify Ticks Ticks3 TildeIntervalMarker TimesRoman Top TrueMargin UnFill UpsideDown Wheel X XEquals XOR XY XYEquals XYZero XYgrid XZEquals XZZero XZero XZgrid Y YEquals YXgrid YZ YZEquals YZZero YZero YZgrid Yn Z ZX ZXgrid ZYgrid ZapfChancery ZapfDingbats _begingroup3 _cputime _draw _eval _image _labelpath _projection _strokepath _texpath aCos aSin aTan abort abs accel acos acosh acot acsc activatequote add addArrow addMargins addSaveFunction addpenarc addpenline adjust alias align all altitude angabscissa angle angpoint animate annotate anticomplementary antipedal apply approximate arc arcarrowsize arccircle arcdir arcfromcenter arcfromfocus arclength arcnodesnumber arcpoint arcsubtended arcsubtendedcenter arctime arctopath array arrow arrow2 arrowbase arrowbasepoints arrowsize ascii asec asin asinh ask assert asy asycode asydir asyfigure asyfilecode asyinclude asywrite atan atan2 atanh atbreakpoint atexit attach attract atupdate autoformat autoscale autoscale3 axes axes3 axialshade axis axiscoverage azimuth babel background bangles bar barmarksize barsize basealign baseline bbox beep begin beginclip begingroup beginpoint between bevel bezier bezierP bezierPP bezierPPP bezulate bibliography bibliographystyle binarytree binarytreeNode binomial bins bisector bisectorpoint bispline blend blockconnector box bqe breakpoint breakpoints brick buildRestoreDefaults buildRestoreThunk buildcycle bulletcolor byte calculateScaling canonical canonicalcartesiansystem cartesiansystem case1 case2 case3 case4 cbrt cd ceil center centerToFocus centroid cevian change2 changecoordsys checkSegment checkconditionlength checker checkincreasing checklengths checkposition checktriangle choose circle circlebarframe circlemarkradius circlenodesnumber circumcenter circumcircle clamped clear clip clipdraw close cmyk code colatitude collect collinear color colorless colors colorspace comma compassmark complement complementary concat concurrent cone conic conicnodesnumber conictype conj connect connected connectedindex containmentTree contains contour contour3 contouredges controlSpecifier convert coordinates coordsys copy copyPairOrTriple cos cosh cot countIntersections cputime crop cropcode cross crossframe crosshatch crossmarksize csc cubicroots curabscissa curlSpecifier curpoint currentarrow currentexitfunction currentmomarrow currentpolarconicroutine curve cut cutafter cutbefore cyclic cylinder deactivatequote debugger deconstruct defaultdir defaultformat defaultpen defined degenerate degrees delete deletepreamble determinant diagonal diamond diffdiv dir dirSpecifier dirtime display distance divisors do_overpaint dot dotframe dotsize downcase draw drawAll drawDoubleLine drawFermion drawGhost drawGluon drawMomArrow drawPRCcylinder drawPRCdisk drawPRCsphere drawPRCtube drawPhoton drawScalar drawVertex drawVertexBox drawVertexBoxO drawVertexBoxX drawVertexO drawVertexOX drawVertexTriangle drawVertexTriangleO drawVertexX drawarrow drawarrow2 drawline drawpixel drawtick duplicate elle ellipse ellipsenodesnumber embed embed3 empty enclose end endScript endclip endgroup endgroup3 endl endpoint endpoints eof eol equation equations erase erasestep erf erfc error errorbar errorbars eval excenter excircle exit exitXasyMode exitfunction exp expfactors expi expm1 exradius extend extension extouch fabs factorial fermat fft fhorner figure file filecode fill filldraw filloutside fillrule filltype find finite finiteDifferenceJacobian firstcut firstframe fit fit2 fixedscaling floor flush fmdefaults fmod focusToCenter font fontcommand fontsize foot format frac frequency fromCenter fromFocus fspline functionshade gamma generate_random_backtrace generateticks gergonne getc getint getpair getreal getstring gettriple gluon gouraudshade graph graphic gray grestore grid grid3 gsave halfbox hatch hdiffdiv hermite hex histogram history hline hprojection hsv hyperbola hyperbolanodesnumber hyperlink hypot identity image incenter incentral incircle increasing incrementposition indexedTransform indexedfigure initXasyMode initdefaults input inradius insert inside integrate interactive interior interp interpolate intersect intersection intersectionpoint intersectionpoints intersections intouch inverse inversion invisible is3D isCCW isDuplicate isnan isogonal isogonalconjugate isotomic isotomicconjugate isparabola italic item jobname key kurtosis kurtosisexcess label labelaxis labelmargin labelpath labels labeltick labelx labelx3 labely labely3 labelz labelz3 lastcut latex latitude latticeshade layer layout ldexp leastsquares legend legenditem length lexorder lift light limits line linear linecap lineinversion linejoin linemargin lineskip linetype linewidth link list lm_enorm lm_evaluate_default lm_lmdif lm_lmpar lm_minimize lm_print_default lm_print_quiet lm_qrfac lm_qrsolv locale locate locatefile location log log10 log1p logaxiscoverage longitude lookup makeNode makedraw makepen map margin markangle markangleradius markanglespace markarc marker markinterval marknodes markrightangle markthin markuniform mass masscenter massformat math max max3 maxAfterTransform maxbezier maxbound maxcoords maxlength maxratio maxtimes mean medial median midpoint min min3 minAfterTransform minbezier minbound minipage minratio mintimes miterlimit mktemp momArrowPath momarrowsize monotonic multifigure nativeformat natural needshipout newl newpage newslide newton newtree nextframe nextnormal nextpage nib nodabscissa none norm normalvideo notaknot nowarn numberpage nurb object offset onpath opacity opposite orientation origin orthic orthocentercenter outformat outline outname outprefix output overloadedMessage overwrite pack pad pairs palette parabola parabolanodesnumber parallel parallelogram partialsum path path3 pattern pause pdf pedal periodic perp perpendicular perpendicularmark phantom phi1 phi2 phi3 photon piecewisestraight point polar polarconicroutine polargraph polygon postcontrol postscript pow10 ppoint prc prc0 precision precontrol prepend printBytecode print_random_addresses project projection purge pwhermite quadrant quadraticroots quantize quarticroots quotient radialshade radians radicalcenter radicalline radius rand randompath rd readline realmult realquarticroots rectangle rectangular rectify reflect relabscissa relative relativedistance reldir relpoint reltime remainder remark removeDuplicates rename replace report resetdefaultpen restore restoredefaults reverse reversevideo rf rfind rgb rgba rgbint rms rotate rotateO rotation round roundbox roundedpath roundrectangle same samecoordsys sameside sample save savedefaults saveline scale scale3 scaleO scaleT scaleless scientific search searchindex searchtree sec secondaryX secondaryY seconds section sector seek seekeof segment sequence setcontour setpens sgn sgnd sharpangle sharpdegrees shift shiftless shipout shipout3 show side simeq simpson sin sinh size size3 skewness skip slant sleep slope slopefield solve solveBVP sort sourceline sphere split sqrt square srand standardizecoordsys startScript stdev step stickframe stickmarksize stickmarkspace stop straight straightness string stripdirectory stripextension stripfile stripsuffix strokepath subdivide subitem subpath substr sum surface symmedial symmedian system tab tableau tan tangent tangential tangents tanh tell tensionSpecifier tensorshade tex texcolor texify texpath texpreamble texreset texshipout texsize textpath thick thin tick tickMax tickMax3 tickMin tickMin3 ticklabelshift ticklocate tildeframe tildemarksize tile tiling time times title titlepage topbox transform transformation transpose trembleFuzz triangle triangleAbc triangleabc triangulate tricoef tridiagonal trilinear trim truepoint tube uncycle unfill uniform unique unit unitrand unitsize unityroot unstraighten upcase updatefunction uperiodic upscale uptodate usepackage usersetting usetypescript usleep value variance variancebiased vbox vector vectorfield verbatim view vline vperiodic vprojection warn warning windingnumber write xaxis xaxis3 xaxis3At xaxisAt xequals xlimits xpart xscale xscaleO xtick xtick3 xtrans yaxis yaxis3 yaxis3At yaxisAt yequals ylimits ypart yscale yscaleO ytick ytick3 ytrans zaxis3 zaxis3At zero zero3 zlimits zpart ztick ztick3 ztrans ))
(defvar asy-variable-name '(
-AliceBlue Align Allow AntiqueWhite Apricot Aqua Aquamarine Aspect Azure BeginPoint Beige Bisque Bittersweet Black BlanchedAlmond Blue BlueGreen BlueViolet Both Break BrickRed Brown BurlyWood BurntOrange CCW CW CadetBlue CarnationPink Center Centered Cerulean Chartreuse Chocolate Coeff Coral CornflowerBlue Cornsilk Crimson Crop Cyan Dandelion DarkBlue DarkCyan DarkGoldenrod DarkGray DarkGreen DarkKhaki DarkMagenta DarkOliveGreen DarkOrange DarkOrchid DarkRed DarkSalmon DarkSeaGreen DarkSlateBlue DarkSlateGray DarkTurquoise DarkViolet DeepPink DeepSkyBlue DefaultHead DimGray DodgerBlue Dotted Down Draw E ENE EPS ESE E_Euler E_PC E_RK2 E_RK3BS Emerald EndPoint Euler Fill FillDraw FireBrick FloralWhite ForestGreen Fuchsia Gainsboro GhostWhite Gold Goldenrod Gray Green GreenYellow Honeydew HookHead Horizontal HotPink I IgnoreAspect IndianRed Indigo Ivory JOIN_IN JOIN_OUT JungleGreen Khaki LM_DWARF LM_MACHEP LM_SQRT_DWARF LM_SQRT_GIANT LM_USERTOL Label Lavender LavenderBlush LawnGreen Left LeftJustified LeftSide LemonChiffon LightBlue LightCoral LightCyan LightGoldenrodYellow LightGreen LightGrey LightPink LightSalmon LightSeaGreen LightSkyBlue LightSlateGray LightSteelBlue LightYellow Lime LimeGreen Linear Linen Log Logarithmic Magenta Mahogany Mark MarkFill Maroon Max MediumAquamarine MediumBlue MediumOrchid MediumPurple MediumSeaGreen MediumSlateBlue MediumSpringGreen MediumTurquoise MediumVioletRed Melon MidPoint MidnightBlue Min MintCream MistyRose Moccasin Move MoveQuiet Mulberry N NE NNE NNW NW NavajoWhite Navy NavyBlue NoAlign NoCrop NoFill NoSide OldLace Olive OliveDrab OliveGreen Orange OrangeRed Orchid Ox Oy PC PaleGoldenrod PaleGreen PaleTurquoise PaleVioletRed PapayaWhip Peach PeachPuff Periwinkle Peru PineGreen Pink Plum PowderBlue ProcessBlue Purple RK2 RK3 RK3BS RK4 RK5 RK5DP RK5F RawSienna Red RedOrange RedViolet Rhodamine Right RightJustified RightSide RosyBrown RoyalBlue RoyalPurple RubineRed S SE SSE SSW SW SaddleBrown Salmon SandyBrown SeaGreen Seashell Sepia Sienna Silver SimpleHead SkyBlue SlateBlue SlateGray Snow SpringGreen SteelBlue Suppress SuppressQuiet Tan TeXHead Teal TealBlue Thistle Ticksize Tomato Turquoise UnFill Up VERSION Value Vertical Violet VioletRed W WNW WSW Wheat White WhiteSmoke WildStrawberry XYAlign YAlign Yellow YellowGreen YellowOrange addpenarc addpenline align allowstepping angularsystem animationdelay appendsuffix arcarrowangle arcarrowfactor arrow2sizelimit arrowangle arrowbarb arrowdir arrowfactor arrowhookfactor arrowlength arrowsizelimit arrowtexfactor authorpen axis axiscoverage axislabelfactor background backgroundcolor backgroundpen barfactor barmarksizefactor basealign baselinetemplate beveljoin bigvertexpen bigvertexsize black blue bm bottom bp brown bullet byfoci byvertices camerafactor chartreuse circlemarkradiusfactor circlenodesnumberfactor circleprecision circlescale cm codefile codepen codeskip colorPen coloredNodes coloredSegments conditionlength conicnodesfactor count cputimeformat crossmarksizefactor currentcoordsys currentlight currentpatterns currentpen currentpicture currentposition currentprojection curvilinearsystem cuttings cyan darkblue darkbrown darkcyan darkgray darkgreen darkgrey darkmagenta darkolive darkred dashdotted dashed datepen dateskip debuggerlines debugging deepblue deepcyan deepgray deepgreen deepgrey deepmagenta deepred default defaultControl defaultS defaultbackpen defaultcoordsys defaultexcursion defaultfilename defaultformat defaultmassformat defaultpen diagnostics differentlengths dot dotfactor dotframe dotted doublelinepen doublelinespacing down duplicateFuzz edge ellipsenodesnumberfactor eps epsgeo epsilon evenodd expansionfactor extendcap exterior fermionpen figureborder figuremattpen file3 firstnode firststep foregroundcolor fuchsia fuzz gapfactor ghostpen gluonamplitude gluonpen gluonratio gray green grey hatchepsilon havepagenumber heavyblue heavycyan heavygray heavygreen heavygrey heavymagenta heavyred hline hwratio hyperbola hyperbolanodesnumberfactor identity4 ignore inXasyMode inch inches includegraphicscommand inf infinity institutionpen intMax intMin interior invert invisible itempen itemskip itemstep labelmargin landscape lastnode left legendhskip legendlinelength legendmargin legendmarkersize legendmaxrelativewidth legendvskip lightblue lightcyan lightgray lightgreen lightgrey lightmagenta lightolive lightred lightyellow line linemargin lm_infmsg lm_shortmsg longdashdotted longdashed magenta magneticRadius mantissaBits markangleradius markangleradiusfactor markanglespace markanglespacefactor mediumblue mediumcyan mediumgray mediumgreen mediumgrey mediummagenta mediumred mediumyellow middle minDistDefault minblockheight minblockwidth mincirclediameter minipagemargin minipagewidth minvertexangle miterjoin mm momarrowfactor momarrowlength momarrowmargin momarrowoffset momarrowpen monoPen morepoints nCircle newbulletcolor ngraph nil nmesh nobasealign nodeMarginDefault nodesystem nomarker nopoint noprimary nullpath nullpen numarray ocgindex oldbulletcolor olive orange origin overpaint page pageheight pagemargin pagenumberalign pagenumberpen pagenumberposition pagewidth paleblue palecyan palegray palegreen palegrey palemagenta palered paleyellow parabolanodesnumberfactor perpfactor phi photonamplitude photonpen photonratio pi pink plain plain_bounds plain_scaling plus preamblenodes pt purple r3 r4a r4b randMax realDigits realEpsilon realMax realMin red relativesystem reverse right roundcap roundjoin royalblue salmon saveFunctions scalarpen sequencereal settings shipped signedtrailingzero solid springgreen sqrtEpsilon squarecap squarepen startposition stdin stdout stepfactor stepfraction steppagenumberpen stepping stickframe stickmarksizefactor stickmarkspacefactor swap textpen ticksize tildeframe tildemarksizefactor tinv titlealign titlepagepen titlepageposition titlepen titleskip top trailingzero treeLevelStep treeMinNodeWidth treeNodeStep trembleAngle trembleFrequency trembleRandom undefined unitcircle unitsquare up urlpen urlskip version vertexpen vertexsize viewportmargin viewportsize vline white wye xformStack yellow ylabelwidth zerotickfuzz zerowinding ))
+AliceBlue Align Allow AntiqueWhite Apricot Aqua Aquamarine Aspect Azure BeginPoint Beige Bisque Bittersweet Black BlanchedAlmond Blue BlueGreen BlueViolet Both Break BrickRed Brown BurlyWood BurntOrange CCW CW CadetBlue CarnationPink Center Centered Cerulean Chartreuse Chocolate Coeff Coral CornflowerBlue Cornsilk Crimson Crop Cyan Dandelion DarkBlue DarkCyan DarkGoldenrod DarkGray DarkGreen DarkKhaki DarkMagenta DarkOliveGreen DarkOrange DarkOrchid DarkRed DarkSalmon DarkSeaGreen DarkSlateBlue DarkSlateGray DarkTurquoise DarkViolet DeepPink DeepSkyBlue DefaultHead DimGray DodgerBlue Dotted Down Draw E ENE EPS ESE E_Euler E_PC E_RK2 E_RK3BS Emerald EndPoint Euler Fill FillDraw FireBrick FloralWhite ForestGreen Fuchsia Gainsboro GhostWhite Gold Goldenrod Gray Green GreenYellow Honeydew HookHead Horizontal HotPink I IgnoreAspect IndianRed Indigo Ivory JOIN_IN JOIN_OUT JungleGreen Khaki LM_DWARF LM_MACHEP LM_SQRT_DWARF LM_SQRT_GIANT LM_USERTOL Label Lavender LavenderBlush LawnGreen Left LeftJustified LeftSide LemonChiffon LightBlue LightCoral LightCyan LightGoldenrodYellow LightGreen LightGrey LightPink LightSalmon LightSeaGreen LightSkyBlue LightSlateGray LightSteelBlue LightYellow Lime LimeGreen Linear Linen Log Logarithmic Magenta Mahogany Mark MarkFill MarkPath Maroon Max MediumAquamarine MediumBlue MediumOrchid MediumPurple MediumSeaGreen MediumSlateBlue MediumSpringGreen MediumTurquoise MediumVioletRed Melon MidPoint MidnightBlue Min MintCream MistyRose Moccasin Move MoveQuiet Mulberry N NE NNE NNW NW NavajoWhite Navy NavyBlue NoAlign NoCrop NoFill NoSide OldLace Olive OliveDrab OliveGreen Orange OrangeRed Orchid Ox Oy PC PaleGoldenrod PaleGreen PaleTurquoise PaleVioletRed PapayaWhip Peach PeachPuff Periwinkle Peru PineGreen Pink Plum PowderBlue ProcessBlue Purple RK2 RK3 RK3BS RK4 RK5 RK5DP RK5F RawSienna Red RedOrange RedViolet Rhodamine Right RightJustified RightSide RosyBrown RoyalBlue RoyalPurple RubineRed S SE SSE SSW SW SaddleBrown Salmon SandyBrown SeaGreen Seashell Sepia Sienna Silver SimpleHead SkyBlue SlateBlue SlateGray Snow SpringGreen SteelBlue Suppress SuppressQuiet Tan TeXHead Teal TealBlue Thistle Ticksize Tomato Turquoise UnFill Up VERSION Value Vertical Violet VioletRed W WNW WSW Wheat White WhiteSmoke WildStrawberry XYAlign YAlign Yellow YellowGreen YellowOrange addpenarc addpenline align allowstepping angularsystem animationdelay appendsuffix arcarrowangle arcarrowfactor arrow2sizelimit arrowangle arrowbarb arrowdir arrowfactor arrowhookfactor arrowlength arrowsizelimit arrowtexfactor authorpen axis axiscoverage axislabelfactor background backgroundcolor backgroundpen barfactor barmarksizefactor basealign baselinetemplate beveljoin bigvertexpen bigvertexsize black blue bm bottom bp brown bullet byfoci byvertices camerafactor chartreuse circlemarkradiusfactor circlenodesnumberfactor circleprecision circlescale cm codefile codepen codeskip colorPen coloredNodes coloredSegments conditionlength conicnodesfactor count cputimeformat crossmarksizefactor currentcoordsys currentlight currentpatterns currentpen currentpicture currentposition currentprojection curvilinearsystem cuttings cyan darkblue darkbrown darkcyan darkgray darkgreen darkgrey darkmagenta darkolive darkred dashdotted dashed datepen dateskip debuggerlines debugging deepblue deepcyan deepgray deepgreen deepgrey deepmagenta deepred default defaultControl defaultS defaultbackpen defaultcoordsys defaultexcursion defaultfilename defaultformat defaultmassformat defaultpen defaultseparator diagnostics differentlengths dot dotfactor dotframe dotted doublelinepen doublelinespacing down duplicateFuzz edge ellipsenodesnumberfactor eps epsgeo epsilon evenodd expansionfactor extendcap exterior fermionpen figureborder figuremattpen file3 firstnode firststep foregroundcolor fuchsia fuzz gapfactor ghostpen gluonamplitude gluonpen gluonratio gray green grey hatchepsilon havepagenumber heavyblue heavycyan heavygray heavygreen heavygrey heavymagenta heavyred hline hwratio hyperbola hyperbolanodesnumberfactor identity4 ignore inXasyMode inch inches includegraphicscommand inf infinity institutionpen intMax intMin interior invert invisible itempen itemskip itemstep labelmargin landscape lastnode left legendhskip legendlinelength legendmargin legendmarkersize legendmaxrelativewidth legendvskip lightblue lightcyan lightgray lightgreen lightgrey lightmagenta lightolive lightred lightyellow line linemargin lm_infmsg lm_shortmsg longdashdotted longdashed magenta magneticRadius mantissaBits markangleradius markangleradiusfactor markanglespace markanglespacefactor mediumblue mediumcyan mediumgray mediumgreen mediumgrey mediummagenta mediumred mediumyellow middle minDistDefault minblockheight minblockwidth mincirclediameter minipagemargin minipagewidth minvertexangle miterjoin mm momarrowfactor momarrowlength momarrowmargin momarrowoffset momarrowpen monoPen morepoints nCircle newbulletcolor ngraph nil nmesh nobasealign nodeMarginDefault nodesystem nomarker nopoint noprimary nullpath nullpen numarray ocgindex oldbulletcolor olive orange origin overpaint page pageheight pagemargin pagenumberalign pagenumberpen pagenumberposition pagewidth paleblue palecyan palegray palegreen palegrey palemagenta palered paleyellow parabolanodesnumberfactor perpfactor phi photonamplitude photonpen photonratio pi pink plain plain_bounds plain_scaling plus preamblenodes pt purple r3 r4a r4b randMax realDigits realEpsilon realMax realMin red relativesystem reverse right roundcap roundjoin royalblue salmon saveFunctions scalarpen sequencereal settings shipped signedtrailingzero solid springgreen sqrtEpsilon squarecap squarepen startposition stdin stdout stepfactor stepfraction steppagenumberpen stepping stickframe stickmarksizefactor stickmarkspacefactor swap textpen ticksize tildeframe tildemarksizefactor tinv titlealign titlepagepen titlepageposition titlepen titleskip top trailingzero treeLevelStep treeMinNodeWidth treeNodeStep trembleAngle trembleFrequency trembleRandom undefined unitcircle unitsquare up urlpen urlskip version vertexpen vertexsize viewportmargin viewportsize vline white wye xformStack yellow ylabelwidth zerotickfuzz zerowinding ))
diff --git a/Master/texmf/asymptote/geometry.asy b/Master/texmf/asymptote/geometry.asy
index e87dc00550c..bbbc823fc54 100644
--- a/Master/texmf/asymptote/geometry.asy
+++ b/Master/texmf/asymptote/geometry.asy
@@ -30,12 +30,22 @@
import math;
import markers;
+
+// A rotation in the direction dir limited to [-90,90]
+// This is useful for rotating text along a line in the direction dir.
+private transform rotate(explicit pair dir)
+{
+ real angle=degrees(dir);
+ if(angle > 90 && angle < 270) angle -= 180;
+ return rotate(angle);
+}
+
// *=======================================================*
// *........................HEADER.........................*
-/*<asyxml><variable type = "real" signature = "epsgeo"><code></asyxml>*/
+/*<asyxml><variable type="real" signature="epsgeo"><code></asyxml>*/
real epsgeo = 10 * sqrt(realEpsilon);/*<asyxml></code><documentation>Variable used in the approximate calculations.</documentation></variable></asyxml>*/
-/*<asyxml><function type = "void" signature = "addMargins(picture, real, real, real, real)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="addMargins(picture,real,real,real,real)"><code></asyxml>*/
void addMargins(picture pic = currentpicture,
real lmargin = 0, real bmargin = 0,
real rmargin = lmargin, real tmargin = bmargin,
@@ -67,13 +77,13 @@ real[] approximate(real[] T)
return map(approximate, T);
}
-/*<asyxml><function type = "real" signature = "binomial(real, real)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="binomial(real,real)"><code></asyxml>*/
real binomial(real n, real k)
{/*<asyxml></code><documentation>Return n!/((n - k)!*k!)</documentation></function></asyxml>*/
return gamma(n + 1)/(gamma(n - k + 1) * gamma(k + 1));
}
-/*<asyxml><function type = "real" signature = "rf(real, real, real)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="rf(real,real,real)"><code></asyxml>*/
real rf(real x, real y, real z)
{/*<asyxml></code><documentation>Computes Carlson's elliptic integral of the first kind.
x, y, and z must be non negative, and at most one can be zero.</documentation></function></asyxml>*/
@@ -109,7 +119,7 @@ real rf(real x, real y, real z)
return (1.0 + (C1 * e2 - C2 - C3 * e3) * e2 + C4 * e3)/sqrt(ave);
}
-/*<asyxml><function type = "real" signature = "rd(real, real, real)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="rd(real,real,real)"><code></asyxml>*/
real rd(real x, real y, real z)
{/*<asyxml></code><documentation>Computes Carlson's elliptic integral of the second kind.
x and y must be positive, and at most one can be zero.
@@ -156,7 +166,7 @@ real rd(real x, real y, real z)
+delz * (C2 * ee + delz * (-C3 * ec + delz * C4 * ea)))/(ave * sqrt(ave));
}
-/*<asyxml><function type = "real" signature = "elle(real, real)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="elle(real,real)"><code></asyxml>*/
real elle(real phi, real k)
{/*<asyxml></code><documentation>Legendre elliptic integral of the 2nd kind,
evaluated using Carlson's functions RD and RF.
@@ -185,7 +195,7 @@ real elle(real phi, real k)
return result;
}
-/*<asyxml><function type = "pair[]" signature = "intersectionpoints(pair, pair, real, real, real, real, real, real)"><code></asyxml>*/
+/*<asyxml><function type="pair[]" signature="intersectionpoints(pair,pair,real,real,real,real,real,real)"><code></asyxml>*/
pair[] intersectionpoints(pair A, pair B,
real a, real b, real c, real d, real f, real g)
{/*<asyxml></code><documentation>Intersection points with the line (AB) and the quadric curve
@@ -215,7 +225,7 @@ pair[] intersectionpoints(pair A, pair B,
return op;
}
-/*<asyxml><function type = "pair[]" signature = "intersectionpoints(pair, pair, real[])"><code></asyxml>*/
+/*<asyxml><function type="pair[]" signature="intersectionpoints(pair,pair,real[])"><code></asyxml>*/
pair[] intersectionpoints(pair A, pair B, real[] equation)
{/*<asyxml></code><documentation>Return the intersection points of the line AB with
the conic whose an equation is
@@ -241,24 +251,24 @@ typedef real dot(pair, pair);/*<asyxml></code><documentation>Function type to ca
/*<asyxml><typedef type = "polar" return = "pair" params = "real, real"><code></asyxml>*/
typedef pair polar(real, real);/*<asyxml></code><documentation>Function type to calculate the coordinates from the polar coordinates.</documentation></typedef></asyxml>*/
-/*<asyxml><struct signature = "coordsys"><code></asyxml>*/
+/*<asyxml><struct signature="coordsys"><code></asyxml>*/
struct coordsys
{/*<asyxml></code><documentation>This structure represents a coordinate system in the plane.</documentation></asyxml>*/
- /*<asyxml><method type = "pair" signature = "relativetodefault(pair)"><code></asyxml>*/
+ /*<asyxml><method type = "pair" signature="relativetodefault(pair)"><code></asyxml>*/
restricted convert relativetodefault = new pair(pair m){return m;};/*<asyxml></code><documentation>Convert a pair given relatively to this coordinate system to
the pair relatively to the default coordinate system.</documentation></method></asyxml>*/
- /*<asyxml><method type = "pair" signature = "defaulttorelativet(pair)"><code></asyxml>*/
+ /*<asyxml><method type = "pair" signature="defaulttorelativet(pair)"><code></asyxml>*/
restricted convert defaulttorelative = new pair(pair m){return m;};/*<asyxml></code><documentation>Convert a pair given relatively to the default coordinate system to
the pair relatively to this coordinate system.</documentation></method></asyxml>*/
- /*<asyxml><method type = "real" signature = "dot(pair, pair)"><code></asyxml>*/
+ /*<asyxml><method type = "real" signature="dot(pair,pair)"><code></asyxml>*/
restricted dot dot = new real(pair m, pair n){return dot(m, n);};/*<asyxml></code><documentation>Return the dot product of this coordinate system.</documentation></method></asyxml>*/
- /*<asyxml><method type = "real" signature = "abs(pair)"><code></asyxml>*/
+ /*<asyxml><method type = "real" signature="abs(pair)"><code></asyxml>*/
restricted abs abs = new real(pair m){return abs(m);};/*<asyxml></code><documentation>Return the modulus of a pair in this coordinate system.</documentation></method></asyxml>*/
- /*<asyxml><method type = "pair" signature = "polar(real, real)"><code></asyxml>*/
+ /*<asyxml><method type = "pair" signature="polar(real,real)"><code></asyxml>*/
restricted polar polar = new pair(real r, real a){return (r * cos(a), r * sin(a));};/*<asyxml></code><documentation>Polar coordinates routine of this coordinate system.</documentation></method></asyxml>*/
- /*<asyxml><property type = "pair" signature = "O, i, j"><code></asyxml>*/
+ /*<asyxml><property type = "pair" signature="O,i,j"><code></asyxml>*/
restricted pair O = (0, 0), i = (1, 0), j = (0, 1);/*<asyxml></code><documentation>Origin and units vector.</documentation></property></asyxml>*/
- /*<asyxml><method type = "void" signature = "init(convert, convert, polar, dot)"><code></asyxml>*/
+ /*<asyxml><method type = "void" signature="init(convert,convert,polar,dot)"><code></asyxml>*/
void init(convert rtd, convert dtr,
polar polar, dot dot)
{/*<asyxml></code><documentation>The default constructor of the coordinate system.</documentation></method></asyxml>*/
@@ -273,13 +283,13 @@ struct coordsys
}
}/*<asyxml></struct></asyxml>*/
-/*<asyxml><operator type = "bool" signature = "==(coordsys, coordsys)"><code></asyxml>*/
+/*<asyxml><operator type = "bool" signature="==(coordsys,coordsys)"><code></asyxml>*/
bool operator ==(coordsys c1, coordsys c2)
{/*<asyxml></code><documentation>Return true iff the coordinate system have the same origin and units vector.</documentation></operator></asyxml>*/
return c1.O == c2.O && c1.i == c2.i && c1.j == c2.j;
}
-/*<asyxml><function type = "coordsys" signature = "cartesiansystem(pair, pair, pair)"><code></asyxml>*/
+/*<asyxml><function type="coordsys" signature="cartesiansystem(pair,pair,pair)"><code></asyxml>*/
coordsys cartesiansystem(pair O = (0, 0), pair i, pair j)
{/*<asyxml></code><documentation>Return the Cartesian coordinate system (O, i, j).</documentation></function></asyxml>*/
coordsys R;
@@ -322,7 +332,7 @@ coordsys cartesiansystem(pair O = (0, 0), pair i, pair j)
}
-/*<asyxml><function type = "void" signature = "show(picture, Label, Label, Label, coordsys, pen, pen, pen, pen, pen)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="show(picture,Label,Label,Label,coordsys,pen,pen,pen,pen,pen)"><code></asyxml>*/
void show(picture pic = currentpicture, Label lo = "$O$",
Label li = "$\vec{\imath}$",
Label lj = "$\vec{\jmath}$",
@@ -347,7 +357,7 @@ void show(picture pic = currentpicture, Label lo = "$O$",
label(pic, lo, O);
}
-/*<asyxml><operator type = "pair" signature = "/(pair, coordsys)"><code></asyxml>*/
+/*<asyxml><operator type = "pair" signature="/(pair,coordsys)"><code></asyxml>*/
pair operator /(pair p, coordsys R)
{/*<asyxml></code><documentation>Return the xy - coordinates of 'p' relatively to
the coordinate system 'R'.
@@ -355,7 +365,7 @@ pair operator /(pair p, coordsys R)
return R.defaulttorelative(p);
}
-/*<asyxml><operator type = "pair" signature = "*(coordsys, pair)"><code></asyxml>*/
+/*<asyxml><operator type = "pair" signature="*(coordsys,pair)"><code></asyxml>*/
pair operator *(coordsys R, pair p)
{/*<asyxml></code><documentation>Return the coordinates of 'p' given in the
xy - coordinates 'R'.
@@ -363,7 +373,7 @@ pair operator *(coordsys R, pair p)
return R.relativetodefault(p);
}
-/*<asyxml><operator type = "path" signature = "*(coordsys, path)"><code></asyxml>*/
+/*<asyxml><operator type = "path" signature="*(coordsys,path)"><code></asyxml>*/
path operator *(coordsys R, path g)
{/*<asyxml></code><documentation>Return the reconstructed path applying R * pair to each node, pre and post control point of 'g'.</documentation></operator></asyxml>*/
guide og = R * point(g, 0);
@@ -381,8 +391,8 @@ path operator *(coordsys R, path g)
return og;
}
-/*<asyxml><operator type = "coordsys" signature = "*(transform, coordsys)"><code></asyxml>*/
-coordsys operator *(transform t, coordsys R)
+/*<asyxml><operator type = "coordsys" signature="*(transform,coordsys)"><code></asyxml>*/
+coordsys operator *(transform t,coordsys R)
{/*<asyxml></code><documentation>Provide transform * coordsys.
Note that shiftless(t) is applied to R.i and R.j.</documentation></operator></asyxml>*/
coordsys oc;
@@ -390,21 +400,21 @@ coordsys operator *(transform t, coordsys R)
return oc;
}
-/*<asyxml><constant type = "coordsys" signature = "defaultcoordsys"><code></asyxml>*/
+/*<asyxml><constant type = "coordsys" signature="defaultcoordsys"><code></asyxml>*/
restricted coordsys defaultcoordsys = cartesiansystem(0, (1, 0), (0, 1));/*<asyxml></code><documentation>One can always refer to the default coordinate system using this constant.</documentation></constant></asyxml>*/
-/*<asyxml><variable type = "coordsys" signature = "currentcoordsys"><code></asyxml>*/
+/*<asyxml><variable type="coordsys" signature="currentcoordsys"><code></asyxml>*/
coordsys currentcoordsys = defaultcoordsys;/*<asyxml></code><documentation>The coordinate system used by default.</documentation></variable></asyxml>*/
-/*<asyxml><struct signature = "point"><code></asyxml>*/
+/*<asyxml><struct signature="point"><code></asyxml>*/
struct point
{/*<asyxml></code><documentation>This structure replaces the pair to embed its coordinate system.
For example, if 'P = point(cartesiansystem((1, 2), i, j), (0, 0))',
P is equal to the pair (1, 2).</documentation></asyxml>*/
- /*<asyxml><property type = "coordsys" signature = "coordsys"><code></asyxml>*/
- coordsys coordsys;/*<asyxml></code><documentation>The coordinate system of this point.</documentation></property><property type = "pair" signature = "coordinates"><code></asyxml>*/
- restricted pair coordinates;/*<asyxml></code><documentation>The coordinates of this point relatively to the coordinate system 'coordsys'.</documentation></property><property type = "real" signature = "x, y"><code></asyxml>*/
+ /*<asyxml><property type = "coordsys" signature="coordsys"><code></asyxml>*/
+ coordsys coordsys;/*<asyxml></code><documentation>The coordinate system of this point.</documentation></property><property type = "pair" signature="coordinates"><code></asyxml>*/
+ restricted pair coordinates;/*<asyxml></code><documentation>The coordinates of this point relatively to the coordinate system 'coordsys'.</documentation></property><property type = "real" signature="x, y"><code></asyxml>*/
restricted real x, y;/*<asyxml></code><documentation>The xpart and the ypart of 'coordinates'.</documentation></property></asyxml>*/
- /*<asyxml><method type = "" signature = "init(coordsys, pair)"><code><property type = "real" signature = "m"><code></asyxml>*/
+ /*<asyxml><method type = "" signature="init(coordsys,pair)"><code><property type = "real" signature="m"><code></asyxml>*/
real m = 1;/*<asyxml></code><documentation>Used to cast mass<->point.</documentation></property></asyxml>*/
void init(coordsys R, pair coordinates, real mass)
{/*<asyxml></code><documentation>The constructor.</documentation></method></asyxml>*/
@@ -416,7 +426,7 @@ struct point
}
}/*<asyxml></struct></asyxml>*/
-/*<asyxml><function type = "point" signature = "point(coordsys, pair, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(coordsys,pair,real)"><code></asyxml>*/
point point(coordsys R, pair p, real m = 1)
{/*<asyxml></code><documentation>Return the point which has the coodinates 'p' in the
coordinate system 'R' and the mass 'm'.</documentation></function></asyxml>*/
@@ -425,7 +435,7 @@ point point(coordsys R, pair p, real m = 1)
return op;
}
-/*<asyxml><function type = "point" signature = "point(explicit pair, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(explicit pair,real)"><code></asyxml>*/
point point(explicit pair p, real m)
{/*<asyxml></code><documentation>Return the point which has the coodinates 'p' in the current
coordinate system and the mass 'm'.</documentation></function></asyxml>*/
@@ -434,7 +444,7 @@ point point(explicit pair p, real m)
return op;
}
-/*<asyxml><function type = "point" signature = "point(coordsys, explicit point, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(coordsys,explicit point,real)"><code></asyxml>*/
point point(coordsys R, explicit point M, real m = M.m)
{/*<asyxml></code><documentation>Return the point of 'R' which has the coordinates of 'M' and the mass 'm'.
Do not confuse this routine with the further routine 'changecoordsys'.</documentation></function></asyxml>*/
@@ -443,7 +453,7 @@ point point(coordsys R, explicit point M, real m = M.m)
return op;
}
-/*<asyxml><function type = "point" signature = "changecoordsys(coordsys, point)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="changecoordsys(coordsys,point)"><code></asyxml>*/
point changecoordsys(coordsys R, point M)
{/*<asyxml></code><documentation>Return the point 'M' in the coordinate system 'coordsys'.
In other words, the returned point marks the same plot as 'M' does.</documentation></function></asyxml>*/
@@ -453,13 +463,13 @@ point changecoordsys(coordsys R, point M)
return op;
}
-/*<asyxml><function type = "pair" signature = "pair coordinates(point)"><code></asyxml>*/
+/*<asyxml><function type="pair" signature="pair coordinates(point)"><code></asyxml>*/
pair coordinates(point M)
{/*<asyxml></code><documentation>Return the coordinates of 'M' in its coordinate system.</documentation></function></asyxml>*/
return M.coordinates;
}
-/*<asyxml><function type = "bool" signature = "bool samecoordsys(bool...point[])"><code></asyxml>*/
+/*<asyxml><function type="bool" signature="bool samecoordsys(bool...point[])"><code></asyxml>*/
bool samecoordsys(bool warn = true ... point[] M)
{/*<asyxml></code><documentation>Return true iff all the points have the same coordinate system.
If 'warn' is true and the coordinate systems are different, a warning is sent.</documentation></function></asyxml>*/
@@ -477,7 +487,7 @@ The operation will be done relative to the default coordinate system.");
return ret;
}
-/*<asyxml><function type = "point[]" signature = "standardizecoordsys(coordsys, bool...point[])"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="standardizecoordsys(coordsys,bool...point[])"><code></asyxml>*/
point[] standardizecoordsys(coordsys R = currentcoordsys,
bool warn = true ... point[] M)
{/*<asyxml></code><documentation>Return the points with the same coordinate system 'R'.
@@ -490,13 +500,13 @@ point[] standardizecoordsys(coordsys R = currentcoordsys,
return op;
}
-/*<asyxml><operator type = "pair" signature = "cast(point)"><code></asyxml>*/
+/*<asyxml><operator type = "pair" signature="cast(point)"><code></asyxml>*/
pair operator cast(point P)
{/*<asyxml></code><documentation>Cast point to pair.</documentation></operator></asyxml>*/
return P.coordsys.relativetodefault(P.coordinates);
}
-/*<asyxml><operator type = "pair[]" signature = "cast(point[])"><code></asyxml>*/
+/*<asyxml><operator type = "pair[]" signature="cast(point[])"><code></asyxml>*/
pair[] operator cast(point[] P)
{/*<asyxml></code><documentation>Cast point[] to pair[].</documentation></operator></asyxml>*/
pair[] op;
@@ -506,14 +516,14 @@ pair[] operator cast(point[] P)
return op;
}
-/*<asyxml><operator type = "point" signature = "cast(pair)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="cast(pair)"><code></asyxml>*/
point operator cast(pair p)
{/*<asyxml></code><documentation>Cast pair to point relatively to the current coordinate
system 'currentcoordsys'.</documentation></operator></asyxml>*/
return point(currentcoordsys, p);
}
-/*<asyxml><operator type = "point[]" signature = "cast(pair[])"><code></asyxml>*/
+/*<asyxml><operator type = "point[]" signature="cast(pair[])"><code></asyxml>*/
point[] operator cast(pair[] p)
{/*<asyxml></code><documentation>Cast pair[] to point[] relatively to the current coordinate
system 'currentcoordsys'.</documentation></operator></asyxml>*/
@@ -524,43 +534,43 @@ point[] operator cast(pair[] p)
return op;
}
-/*<asyxml><function type = "pair" signature = "locate(point)"><code></asyxml>*/
+/*<asyxml><function type="pair" signature="locate(point)"><code></asyxml>*/
pair locate(point P)
{/*<asyxml></code><documentation>Return the coordinates of 'P' in the default coordinate system.</documentation></function></asyxml>*/
return P.coordsys * P.coordinates;
}
-/*<asyxml><function type = "point" signature = "locate(pair)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="locate(pair)"><code></asyxml>*/
point locate(pair p)
{/*<asyxml></code><documentation>Return the point in the current coordinate system 'currentcoordsys'.</documentation></function></asyxml>*/
return p; //automatic casting 'pair to point'.
}
-/*<asyxml><operator type = "point" signature = "*(real, explicit point)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="*(real,explicit point)"><code></asyxml>*/
point operator *(real x, explicit point P)
{/*<asyxml></code><documentation>Multiply the coordinates (not the mass) of 'P' by 'x'.</documentation></operator></asyxml>*/
return point(P.coordsys, x * P.coordinates, P.m);
}
-/*<asyxml><operator type = "point" signature = "/(explicit point, real)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="/(explicit point,real)"><code></asyxml>*/
point operator /(explicit point P, real x)
{/*<asyxml></code><documentation>Divide the coordinates (not the mass) of 'P' by 'x'.</documentation></operator></asyxml>*/
return point(P.coordsys, P.coordinates/x, P.m);
}
-/*<asyxml><operator type = "point" signature = "/(real, explicit point)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="/(real,explicit point)"><code></asyxml>*/
point operator /(real x, explicit point P)
{/*<asyxml></code><documentation></documentation></operator></asyxml>*/
return point(P.coordsys, x/P.coordinates, P.m);
}
-/*<asyxml><operator type = "point" signature = "-(explicit point)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="-(explicit point)"><code></asyxml>*/
point operator -(explicit point P)
{/*<asyxml></code><documentation>-P. The mass is inchanged.</documentation></operator></asyxml>*/
return point(P.coordsys, -P.coordinates, P.m);
}
-/*<asyxml><operator type = "point" signature = "+(explicit point, explicit point)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="+(explicit point,explicit point)"><code></asyxml>*/
point operator +(explicit point P1, explicit point P2)
{/*<asyxml></code><documentation>Provide 'point + point'.
If the two points haven't the same coordinate system, a warning is sent and the
@@ -571,7 +581,7 @@ point operator +(explicit point P1, explicit point P2)
return point(R, P[0].coordinates + P[1].coordinates, P1.m + P2.m);
}
-/*<asyxml><operator type = "point" signature = "+(explicit point, explicit pair)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="+(explicit point,explicit pair)"><code></asyxml>*/
point operator +(explicit point P1, explicit pair p2)
{/*<asyxml></code><documentation>Provide 'point + pair'.
The pair 'p2' is supposed to be coordinates relatively to the coordinates system of 'P1'.
@@ -584,13 +594,13 @@ point operator +(explicit pair p1, explicit point p2)
return p2 + p1;
}
-/*<asyxml><operator type = "point" signature = "-(explicit point, explicit point)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="-(explicit point,explicit point)"><code></asyxml>*/
point operator -(explicit point P1, explicit point P2)
{/*<asyxml></code><documentation>Provide 'point - point'.</documentation></operator></asyxml>*/
return P1 + (-P2);
}
-/*<asyxml><operator type = "point" signature = "-(explicit point, explicit pair)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="-(explicit point,explicit pair)"><code></asyxml>*/
point operator -(explicit point P1, explicit pair p2)
{/*<asyxml></code><documentation>Provide 'point - pair'.
The pair 'p2' is supposed to be coordinates relatively to the coordinates system of 'P1'.</documentation></operator></asyxml>*/
@@ -601,7 +611,7 @@ point operator -(explicit pair p1, explicit point P2)
return p1 + (-P2);
}
-/*<asyxml><operator type = "point" signature = "*(transform, explicit point)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="*(transform,explicit point)"><code></asyxml>*/
point operator *(transform t, explicit point P)
{/*<asyxml></code><documentation>Provide 'transform * point'.
Note that the transforms scale, xscale, yscale and rotate are carried out relatively
@@ -614,7 +624,7 @@ point operator *(transform t, explicit point P)
return point(R, (t * locate(P))/R, P.m);
}
-/*<asyxml><operator type = "point" signature = "*(explicit point, explicit point)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="*(explicit point,explicit point)"><code></asyxml>*/
point operator *(explicit point P1, explicit point P2)
{/*<asyxml></code><documentation>Provide 'point * point'.
The resulted mass is the mass of P2</documentation></operator></asyxml>*/
@@ -623,7 +633,7 @@ point operator *(explicit point P1, explicit point P2)
return point(R, P[0].coordinates * P[1].coordinates, P2.m);
}
-/*<asyxml><operator type = "point" signature = "*(explicit point, explicit pair)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="*(explicit point,explicit pair)"><code></asyxml>*/
point operator *(explicit point P1, explicit pair p2)
{/*<asyxml></code><documentation>Provide 'point * pair'.
The pair 'p2' is supposed to be the coordinates of
@@ -637,31 +647,31 @@ point operator *(explicit pair p1, explicit point p2)
return p2 * p1;
}
-/*<asyxml><operator type = "bool" signature = "==(explicit point, explicit point)"><code></asyxml>*/
+/*<asyxml><operator type = "bool" signature="==(explicit point,explicit point)"><code></asyxml>*/
bool operator ==(explicit point M, explicit point N)
{/*<asyxml></code><documentation>Provide the test 'M == N' wish returns true iff MN < EPS</documentation></operator></asyxml>*/
return abs(locate(M) - locate(N)) < EPS;
}
-/*<asyxml><operator type = "bool" signature = "!=(explicit point, explicit point)"><code></asyxml>*/
+/*<asyxml><operator type = "bool" signature="!=(explicit point,explicit point)"><code></asyxml>*/
bool operator !=(explicit point M, explicit point N)
{/*<asyxml></code><documentation>Provide the test 'M != N' wish return true iff MN >= EPS</documentation></operator></asyxml>*/
return !(M == N);
}
-/*<asyxml><operator type = "guide" signature = "cast(point)"><code></asyxml>*/
+/*<asyxml><operator type = "guide" signature="cast(point)"><code></asyxml>*/
guide operator cast(point p)
{/*<asyxml></code><documentation>Cast point to guide.</documentation></operator></asyxml>*/
return locate(p);
}
-/*<asyxml><operator type = "path" signature = "cast(point)"><code></asyxml>*/
+/*<asyxml><operator type = "path" signature="cast(point)"><code></asyxml>*/
path operator cast(point p)
{/*<asyxml></code><documentation>Cast point to path.</documentation></operator></asyxml>*/
return locate(p);
}
-/*<asyxml><function type = "void" signature = "dot(picture, Label, explicit point, align, string, pen)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="dot(picture,Label,explicit point,align,string,pen)"><code></asyxml>*/
void dot(picture pic = currentpicture, Label L, explicit point Z,
align align = NoAlign,
string format = defaultformat, pen p = currentpen)
@@ -678,56 +688,56 @@ void dot(picture pic = currentpicture, Label L, explicit point Z,
add(pic, L);
}
-/*<asyxml><function type = "real" signature = "abs(coordsys, pair)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="abs(coordsys,pair)"><code></asyxml>*/
real abs(coordsys R, pair m)
{/*<asyxml></code><documentation>Return the modulus |m| in the coordinate system 'R'.</documentation></function></asyxml>*/
return R.abs(m);
}
-/*<asyxml><function type = "real" signature = "abs(explicit point)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="abs(explicit point)"><code></asyxml>*/
real abs(explicit point M)
{/*<asyxml></code><documentation>Return the modulus |M| in its coordinate system.</documentation></function></asyxml>*/
return M.coordsys.abs(M.coordinates);
}
-/*<asyxml><function type = "real" signature = "length(explicit point)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="length(explicit point)"><code></asyxml>*/
real length(explicit point M)
{/*<asyxml></code><documentation>Return the modulus |M| in its coordinate system (same as 'abs').</documentation></function></asyxml>*/
return M.coordsys.abs(M.coordinates);
}
-/*<asyxml><function type = "point" signature = "conj(explicit point)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="conj(explicit point)"><code></asyxml>*/
point conj(explicit point M)
{/*<asyxml></code><documentation>Conjugate.</documentation></function></asyxml>*/
return point(M.coordsys, conj(M.coordinates), M.m);
}
-/*<asyxml><function type = "real" signature = "degrees(explicit point, coordsys, bool)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="degrees(explicit point,coordsys,bool)"><code></asyxml>*/
real degrees(explicit point M, coordsys R = M.coordsys, bool warn = true)
{/*<asyxml></code><documentation>Return the angle of M (in degrees) relatively to 'R'.</documentation></function></asyxml>*/
return (degrees(locate(M) - R.O, warn) - degrees(R.i))%360;
}
-/*<asyxml><function type = "real" signature = "angle(explicit point, coordsys, bool)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="angle(explicit point,coordsys,bool)"><code></asyxml>*/
real angle(explicit point M, coordsys R = M.coordsys, bool warn = true)
{/*<asyxml></code><documentation>Return the angle of M (in radians) relatively to 'R'.</documentation></function></asyxml>*/
return radians(degrees(M, R, warn));
}
-/*<asyxml><function type = "bool" signature = "finite(explicit point)"><code></asyxml>*/
+/*<asyxml><function type="bool" signature="finite(explicit point)"><code></asyxml>*/
bool finite(explicit point p)
{/*<asyxml></code><documentation>Avoid to compute 'finite((pair)(infinite_point))'.</documentation></function></asyxml>*/
return finite(p.coordinates);
}
-/*<asyxml><function type = "real" signature = "dot(point, point)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="dot(point,point)"><code></asyxml>*/
real dot(point A, point B)
{/*<asyxml></code><documentation>Return the dot product in the coordinate system of 'A'.</documentation></function></asyxml>*/
point[] P = standardizecoordsys(A.coordsys, A, B);
return P[0].coordsys.dot(P[0].coordinates, P[1].coordinates);
}
-/*<asyxml><function type = "real" signature = "dot(point, explicit pair)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="dot(point,explicit pair)"><code></asyxml>*/
real dot(point A, explicit pair B)
{/*<asyxml></code><documentation>Return the dot product in the default coordinate system.
dot(explicit pair, point) is also defined.</documentation></function></asyxml>*/
@@ -738,13 +748,13 @@ real dot(explicit pair A, point B)
return dot(A, locate(B));
}
-/*<asyxml><function type = "transforms" signature = "rotateO(real)"><code></asyxml>*/
+/*<asyxml><function type="transforms" signature="rotateO(real)"><code></asyxml>*/
transform rotateO(real a)
{/*<asyxml></code><documentation>Rotation around the origin of the current coordinate system.</documentation></function></asyxml>*/
return rotate(a, currentcoordsys.O);
};
-/*<asyxml><function type = "transform" signature = "projection(point, point)"><code></asyxml>*/
+/*<asyxml><function type="transform" signature="projection(point,point)"><code></asyxml>*/
transform projection(point A, point B)
{/*<asyxml></code><documentation>Return the orthogonal projection on the line (AB).</documentation></function></asyxml>*/
pair dir = unit(locate(A) - locate(B));
@@ -760,7 +770,7 @@ transform projection(point A, point B)
return t;
}
-/*<asyxml><function type = "transform" signature = "projection(point, point, point, point, bool)"><code></asyxml>*/
+/*<asyxml><function type="transform" signature="projection(point,point,point,point,bool)"><code></asyxml>*/
transform projection(point A, point B, point C, point D, bool safe = false)
{/*<asyxml></code><documentation>Return the (CD) parallel projection on (AB).
If 'safe = true' and (AB)//(CD) return the identity.
@@ -783,14 +793,14 @@ transform projection(point A, point B, point C, point D, bool safe = false)
return t;
}
-/*<asyxml><function type = "transform" signature = "scale(real, point)"><code></asyxml>*/
+/*<asyxml><function type="transform" signature="scale(real,point)"><code></asyxml>*/
transform scale(real k, point M)
{/*<asyxml></code><documentation>Homothety.</documentation></function></asyxml>*/
pair P = locate(M);
return shift(P) * scale(k) * shift(-P);
}
-/*<asyxml><function type = "transform" signature = "xscale(real, point)"><code></asyxml>*/
+/*<asyxml><function type="transform" signature="xscale(real,point)"><code></asyxml>*/
transform xscale(real k, point M)
{/*<asyxml></code><documentation>xscale from 'M' relatively to the x - axis of the coordinate system of 'M'.</documentation></function></asyxml>*/
pair P = locate(M);
@@ -798,7 +808,7 @@ transform xscale(real k, point M)
return (shift(P) * rotate(a)) * xscale(k) * (rotate(-a) * shift(-P));
}
-/*<asyxml><function type = "transform" signature = "yscale(real, point)"><code></asyxml>*/
+/*<asyxml><function type="transform" signature="yscale(real,point)"><code></asyxml>*/
transform yscale(real k, point M)
{/*<asyxml></code><documentation>yscale from 'M' relatively to the y - axis of the coordinate system of 'M'.</documentation></function></asyxml>*/
pair P = locate(M);
@@ -806,7 +816,7 @@ transform yscale(real k, point M)
return (shift(P) * rotate(a)) * yscale(k) * (rotate(-a) * shift(-P));
}
-/*<asyxml><function type = "transform" signature = "scale(real, point, point, point, point, bool)"><code></asyxml>*/
+/*<asyxml><function type="transform" signature="scale(real,point,point,point,point,bool)"><code></asyxml>*/
transform scale(real k, point A, point B, point C, point D, bool safe = false)
{/*<asyxml></code><documentation><url href = "http://fr.wikipedia.org/wiki/Affinit%C3%A9_%28math%C3%A9matiques%29"/>
(help me for English translation...)
@@ -831,38 +841,38 @@ transform scale(real k, point A, point B, point C, point D, bool safe = false)
return t;
}
-/*<asyxml><function type = "transform" signature = "scaleO(real)"><code></asyxml>*/
+/*<asyxml><function type="transform" signature="scaleO(real)"><code></asyxml>*/
transform scaleO(real x)
{/*<asyxml></code><documentation>Homothety from the origin of the current coordinate system.</documentation></function></asyxml>*/
return scale(x, (0, 0));
}
-/*<asyxml><function type = "transform" signature = "xscaleO(real)"><code></asyxml>*/
+/*<asyxml><function type="transform" signature="xscaleO(real)"><code></asyxml>*/
transform xscaleO(real x)
{/*<asyxml></code><documentation>xscale from the origin and relatively to the current coordinate system.</documentation></function></asyxml>*/
return scale(x, (0, 0), (0, 1), (0, 0), (1, 0));
}
-/*<asyxml><function type = "transform" signature = "yscaleO(real)"><code></asyxml>*/
+/*<asyxml><function type="transform" signature="yscaleO(real)"><code></asyxml>*/
transform yscaleO(real x)
{/*<asyxml></code><documentation>yscale from the origin and relatively to the current coordinate system.</documentation></function></asyxml>*/
return scale(x, (0, 0), (1, 0), (0, 0), (0, 1));
}
-/*<asyxml><struct signature = "vector"><code></asyxml>*/
+/*<asyxml><struct signature="vector"><code></asyxml>*/
struct vector
{/*<asyxml></code><documentation>Like a point but casting to pair, adding etc does not take account
- of the origin of the coordinate system.</documentation><property type = "point" signature = "v"><code></asyxml>*/
+ of the origin of the coordinate system.</documentation><property type = "point" signature="v"><code></asyxml>*/
point v;/*<asyxml></code><documentation>Coordinates as a point (embed coordinate system and pair).</documentation></property></asyxml>*/
}/*<asyxml></struct></asyxml>*/
-/*<asyxml><operator type = "point" signature = "cast(vector)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="cast(vector)"><code></asyxml>*/
point operator cast(vector v)
{/*<asyxml></code><documentation>Cast vector 'v' to point 'M' so that OM = v.</documentation></operator></asyxml>*/
return v.v;
}
-/*<asyxml><operator type = "vector" signature = "cast(pair)"><code></asyxml>*/
+/*<asyxml><operator type = "vector" signature="cast(pair)"><code></asyxml>*/
vector operator cast(pair v)
{/*<asyxml></code><documentation>Cast pair to vector relatively to the current coordinate
system 'currentcoordsys'.</documentation></operator></asyxml>*/
@@ -871,7 +881,7 @@ vector operator cast(pair v)
return ov;
}
-/*<asyxml><operator type = "vector" signature = "cast(explicit point)"><code></asyxml>*/
+/*<asyxml><operator type = "vector" signature="cast(explicit point)"><code></asyxml>*/
vector operator cast(explicit point v)
{/*<asyxml></code><documentation>A point can be interpreted like a vector using the code
'(vector)a_point'.</documentation></operator></asyxml>*/
@@ -880,19 +890,19 @@ vector operator cast(explicit point v)
return ov;
}
-/*<asyxml><operator type = "pair" signature = "cast(explicit vector)"><code></asyxml>*/
+/*<asyxml><operator type = "pair" signature="cast(explicit vector)"><code></asyxml>*/
pair operator cast(explicit vector v)
{/*<asyxml></code><documentation>Cast vector to pair (the coordinates of 'v' in the default coordinate system).</documentation></operator></asyxml>*/
return locate(v.v) - v.v.coordsys.O;
}
-/*<asyxml><operator type = "align" signature = "cast(vector)"><code></asyxml>*/
+/*<asyxml><operator type = "align" signature="cast(vector)"><code></asyxml>*/
align operator cast(vector v)
{/*<asyxml></code><documentation>Cast vector to align.</documentation></operator></asyxml>*/
return (pair)v;
}
-/*<asyxml><function type = "vector" signature = "vector(coordsys, pair)"><code></asyxml>*/
+/*<asyxml><function type="vector" signature="vector(coordsys, pair)"><code></asyxml>*/
vector vector(coordsys R = currentcoordsys, pair v)
{/*<asyxml></code><documentation>Return the vector of 'R' which has the coordinates 'v'.</documentation></function></asyxml>*/
vector ov;
@@ -900,33 +910,33 @@ vector vector(coordsys R = currentcoordsys, pair v)
return ov;
}
-/*<asyxml><function type = "vector" signature = "vector(point)"><code></asyxml>*/
+/*<asyxml><function type="vector" signature="vector(point)"><code></asyxml>*/
vector vector(point M)
{/*<asyxml></code><documentation>Return the vector OM, where O is the origin of the coordinate system of 'M'.
Useful to write 'vector(P - M);' instead of '(vector)(P - M)'.</documentation></function></asyxml>*/
return M;
}
-/*<asyxml><function type = "point" signature = "point(explicit vector)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(explicit vector)"><code></asyxml>*/
point point(explicit vector u)
{/*<asyxml></code><documentation>Return the point M so that OM = u, where O is the origin of the coordinate system of 'u'.</documentation></function></asyxml>*/
return u.v;
}
-/*<asyxml><function type = "pair" signature = "locate(explicit vector)"><code></asyxml>*/
+/*<asyxml><function type="pair" signature="locate(explicit vector)"><code></asyxml>*/
pair locate(explicit vector v)
{/*<asyxml></code><documentation>Return the coordinates of 'v' in the default coordinate system (like casting vector to pair).</documentation></function></asyxml>*/
return (pair)v;
}
-/*<asyxml><function type = "void" signature = "show(Label, pen, arrowbar)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="show(Label,pen,arrowbar)"><code></asyxml>*/
void show(Label L, vector v, pen p = currentpen, arrowbar arrow = Arrow)
{/*<asyxml></code><documentation>Draw the vector v (from the origin of its coordinate system).</documentation></function></asyxml>*/
coordsys R = v.v.coordsys;
draw(L, R.O--v.v, p, arrow);
}
-/*<asyxml><function type = "vector" signature = "changecoordsys(coordsys, vector)"><code></asyxml>*/
+/*<asyxml><function type="vector" signature="changecoordsys(coordsys,vector)"><code></asyxml>*/
vector changecoordsys(coordsys R, vector v)
{/*<asyxml></code><documentation>Return the vector 'v' relatively to coordinate system 'R'.</documentation></function></asyxml>*/
vector ov;
@@ -934,49 +944,49 @@ vector changecoordsys(coordsys R, vector v)
return ov;
}
-/*<asyxml><operator type = "vector" signature = "*(real, explicit vector)"><code></asyxml>*/
+/*<asyxml><operator type = "vector" signature="*(real,explicit vector)"><code></asyxml>*/
vector operator *(real x, explicit vector v)
{/*<asyxml></code><documentation>Provide real * vector.</documentation></operator></asyxml>*/
return x * v.v;
}
-/*<asyxml><operator type = "vector" signature = "/(explicit vector, real)"><code></asyxml>*/
+/*<asyxml><operator type = "vector" signature="/(explicit vector,real)"><code></asyxml>*/
vector operator /(explicit vector v, real x)
{/*<asyxml></code><documentation>Provide vector/real</documentation></operator></asyxml>*/
return v.v/x;
}
-/*<asyxml><operator type = "vector" signature = "*(transform t, explicit vector)"><code></asyxml>*/
+/*<asyxml><operator type = "vector" signature="*(transform t,explicit vector)"><code></asyxml>*/
vector operator *(transform t, explicit vector v)
{/*<asyxml></code><documentation>Provide transform * vector.</documentation></operator></asyxml>*/
return t * v.v;
}
-/*<asyxml><operator type = "vector" signature = "*(explicit point, explicit vector)"><code></asyxml>*/
+/*<asyxml><operator type = "vector" signature="*(explicit point,explicit vector)"><code></asyxml>*/
vector operator *(explicit point M, explicit vector v)
{/*<asyxml></code><documentation>Provide point * vector</documentation></operator></asyxml>*/
return M * v.v;
}
-/*<asyxml><operator type = "point" signature = "+(explicit point, explicit vector)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="+(explicit point,explicit vector)"><code></asyxml>*/
point operator +(point M, explicit vector v)
{/*<asyxml></code><documentation>Return 'M' shifted by 'v'.</documentation></operator></asyxml>*/
return shift(locate(v)) * M;
}
-/*<asyxml><operator type = "point" signature = "-(explicit point, explicit vector)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="-(explicit point,explicit vector)"><code></asyxml>*/
point operator -(point M, explicit vector v)
{/*<asyxml></code><documentation>Return 'M' shifted by '-v'.</documentation></operator></asyxml>*/
return shift(-locate(v)) * M;
}
-/*<asyxml><operator type = "vector" signature = "-(explicit vector)"><code></asyxml>*/
+/*<asyxml><operator type = "vector" signature="-(explicit vector)"><code></asyxml>*/
vector operator -(explicit vector v)
{/*<asyxml></code><documentation>Provide -v.</documentation></operator></asyxml>*/
return -v.v;
}
-/*<asyxml><operator type = "point" signature = "+(explicit pair, explicit vector)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="+(explicit pair,explicit vector)"><code></asyxml>*/
point operator +(explicit pair m, explicit vector v)
{/*<asyxml></code><documentation>The pair 'm' is supposed to be the coordinates of
a point in the current coordinates system 'currentcoordsys'.
@@ -984,7 +994,7 @@ point operator +(explicit pair m, explicit vector v)
return locate(m) + v;
}
-/*<asyxml><operator type = "point" signature = "-(explicit pair, explicit vector)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="-(explicit pair,explicit vector)"><code></asyxml>*/
point operator -(explicit pair m, explicit vector v)
{/*<asyxml></code><documentation>The pair 'm' is supposed to be the coordinates of
a point in the current coordinates system 'currentcoordsys'.
@@ -992,7 +1002,7 @@ point operator -(explicit pair m, explicit vector v)
return m + (-v);
}
-/*<asyxml><operator type = "vector" signature = "+(explicit vector, explicit vector)"><code></asyxml>*/
+/*<asyxml><operator type = "vector" signature="+(explicit vector,explicit vector)"><code></asyxml>*/
vector operator +(explicit vector v1, explicit vector v2)
{/*<asyxml></code><documentation>Provide vector + vector.
If the two vector haven't the same coordinate system, the returned
@@ -1002,7 +1012,7 @@ vector operator +(explicit vector v1, explicit vector v2)
return vector(R, (locate(v1) + locate(v2))/R);
}
-/*<asyxml><operator type = "vector" signature = "-(explicit vector, explicit vector)"><code></asyxml>*/
+/*<asyxml><operator type = "vector" signature="-(explicit vector, explicit vector)"><code></asyxml>*/
vector operator -(explicit vector v1, explicit vector v2)
{/*<asyxml></code><documentation>Provide vector - vector.
If the two vector haven't the same coordinate system, the returned
@@ -1010,31 +1020,31 @@ vector operator -(explicit vector v1, explicit vector v2)
return v1 + (-v2);
}
-/*<asyxml><operator type = "bool" signature = "==(explicit vector, explicit vector)"><code></asyxml>*/
+/*<asyxml><operator type = "bool" signature="==(explicit vector,explicit vector)"><code></asyxml>*/
bool operator ==(explicit vector u, explicit vector v)
{/*<asyxml></code><documentation>Return true iff |u - v|<EPS.</documentation></operator></asyxml>*/
return abs(u - v) < EPS;
}
-/*<asyxml><function type = "bool" signature = "collinear(vector, vector)"><code></asyxml>*/
+/*<asyxml><function type="bool" signature="collinear(vector,vector)"><code></asyxml>*/
bool collinear(vector u, vector v)
{/*<asyxml></code><documentation>Return 'true' iff the vectors 'u' and 'v' are collinear.</documentation></function></asyxml>*/
return abs(ypart((conj((pair)u) * (pair)v))) < EPS;
}
-/*<asyxml><function type = "vector" signature = "unit(point)"><code></asyxml>*/
+/*<asyxml><function type="vector" signature="unit(point)"><code></asyxml>*/
vector unit(point M)
{/*<asyxml></code><documentation>Return the unit vector according to the modulus of its coordinate system.</documentation></function></asyxml>*/
return M/abs(M);
}
-/*<asyxml><function type = "vector" signature = "unit(vector)"><code></asyxml>*/
+/*<asyxml><function type="vector" signature="unit(vector)"><code></asyxml>*/
vector unit(vector u)
{/*<asyxml></code><documentation>Return the unit vector according to the modulus of its coordinate system.</documentation></function></asyxml>*/
return u.v/abs(u.v);
}
-/*<asyxml><function type = "real" signature = "degrees(vector, coordsys, bool)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="degrees(vector,coordsys,bool)"><code></asyxml>*/
real degrees(vector v,
coordsys R = v.v.coordsys,
bool warn = true)
@@ -1042,7 +1052,7 @@ real degrees(vector v,
return (degrees(locate(v), warn) - degrees(R.i))%360;
}
-/*<asyxml><function type = "real" signature = "angle(vector, coordsys, bool)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="angle(vector,coordsys,bool)"><code></asyxml>*/
real angle(explicit vector v,
coordsys R = v.v.coordsys,
bool warn = true)
@@ -1050,13 +1060,13 @@ real angle(explicit vector v,
return radians(degrees(v, R, warn));
}
-/*<asyxml><function type = "vector" signature = "conj(explicit vector)"><code></asyxml>*/
+/*<asyxml><function type="vector" signature="conj(explicit vector)"><code></asyxml>*/
vector conj(explicit vector u)
{/*<asyxml></code><documentation>Conjugate.</documentation></function></asyxml>*/
return conj(u.v);
}
-/*<asyxml><function type = "transform" signature = "rotate(explicit vector)"><code></asyxml>*/
+/*<asyxml><function type="transform" signature="rotate(explicit vector)"><code></asyxml>*/
transform rotate(explicit vector dir)
{/*<asyxml></code><documentation>A rotation in the direction 'dir' limited to [-90, 90]
This is useful for rotating text along a line in the direction dir.
@@ -1070,37 +1080,37 @@ transform rotate(explicit point dir){return rotate(locate(vector(dir)));}
// *=======================================================*
// *.........................BASES.........................*
-/*<asyxml><variable type = "point" signature = "origin"><code></asyxml>*/
+/*<asyxml><variable type="point" signature="origin"><code></asyxml>*/
point origin = point(defaultcoordsys, (0, 0));/*<asyxml></code><documentation>The origin of the current coordinate system.</documentation></variable></asyxml>*/
-/*<asyxml><function type = "point" signature = "origin(coordsys)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="origin(coordsys)"><code></asyxml>*/
point origin(coordsys R = currentcoordsys)
{/*<asyxml></code><documentation>Return the origin of the coordinate system 'R'.</documentation></function></asyxml>*/
return point(R, (0, 0)); //use automatic casting;
}
-/*<asyxml><variable type = "real" signature = "linemargin"><code></asyxml>*/
+/*<asyxml><variable type="real" signature="linemargin"><code></asyxml>*/
real linemargin = 0;/*<asyxml></code><documentation>Margin used to draw lines.</documentation></variable></asyxml>*/
-/*<asyxml><function type = "real" signature = "linemargin()"><code></asyxml>*/
+/*<asyxml><function type="real" signature="linemargin()"><code></asyxml>*/
real linemargin()
{/*<asyxml></code><documentation>Return the margin used to draw lines.</documentation></function></asyxml>*/
return linemargin;
}
-/*<asyxml><variable type = "pen" signature = "addpenline"><code></asyxml>*/
+/*<asyxml><variable type="pen" signature="addpenline"><code></asyxml>*/
pen addpenline = squarecap;/*<asyxml></code><documentation>Add this property to the drawing pen of "finish" lines.</documentation></variable></asyxml>*/
pen addpenline(pen p) {
return addpenline + p;
}
-/*<asyxml><variable type = "pen" signature = "addpenarc"><code></asyxml>*/
+/*<asyxml><variable type="pen" signature="addpenarc"><code></asyxml>*/
pen addpenarc = squarecap;/*<asyxml></code><documentation>Add this property to the drawing pen of arcs.</documentation></variable></asyxml>*/
pen addpenarc(pen p) {return addpenarc + p;}
-/*<asyxml><variable type = "string" signature = "defaultmassformat"><code></asyxml>*/
-string defaultmassformat = "$\left(%L;%.4g \ right)$";/*<asyxml></code><documentation>Format used to construct the default label of masses.</documentation></variable></asyxml>*/
+/*<asyxml><variable type="string" signature="defaultmassformat"><code></asyxml>*/
+string defaultmassformat = "$\left(%L;%.4g\right)$";/*<asyxml></code><documentation>Format used to construct the default label of masses.</documentation></variable></asyxml>*/
-/*<asyxml><function type = "int" signature = "sgnd(real)"><code></asyxml>*/
+/*<asyxml><function type="int" signature="sgnd(real)"><code></asyxml>*/
int sgnd(real x)
{/*<asyxml></code><documentation>Return the -1 if x < 0, 1 if x >= 0.</documentation></function></asyxml>*/
return (x == 0) ? 1 : sgn(x);
@@ -1110,27 +1120,27 @@ int sgnd(int x)
return (x == 0) ? 1 : sgn(x);
}
-/*<asyxml><function type = "bool" signature = "defined(pair)"><code></asyxml>*/
+/*<asyxml><function type="bool" signature="defined(pair)"><code></asyxml>*/
bool defined(point P)
{/*<asyxml></code><documentation>Return true iff the coordinates of 'P' are finite.</documentation></function></asyxml>*/
return finite(P.coordinates);
}
-/*<asyxml><function type = "bool" signature = "onpath(picture, path, point, pen)"><code></asyxml>*/
+/*<asyxml><function type="bool" signature="onpath(picture,path,point,pen)"><code></asyxml>*/
bool onpath(picture pic = currentpicture, path g, point M, pen p = currentpen)
{/*<asyxml></code><documentation>Return true iff 'M' is on the path drawn with the pen 'p' in 'pic'.</documentation></function></asyxml>*/
transform t = inverse(pic.calculateTransform());
return intersect(g, shift(locate(M)) * scale(linewidth(p)/2) * t * unitcircle).length > 0;
}
-/*<asyxml><function type = "bool" signature = "sameside(point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="bool" signature="sameside(point,point,point)"><code></asyxml>*/
bool sameside(point M, point N, point O)
{/*<asyxml></code><documentation>Return 'true' iff 'M' and 'N' are same side of the point 'O'.</documentation></function></asyxml>*/
pair m = M, n = N, o = O;
return dot(m - o, n - o) >= -epsgeo;
}
-/*<asyxml><function type = "bool" signature = "between(point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="bool" signature="between(point,point,point)"><code></asyxml>*/
bool between(point M, point O, point N)
{/*<asyxml></code><documentation>Return 'true' iff 'O' is between 'M' and 'N'.</documentation></function></asyxml>*/
return (!sameside(N, M, O) || M == O || N == O);
@@ -1224,7 +1234,7 @@ private void Drawline(picture pic = currentpicture, Label L = "", pair P, bool d
});
}
-/*<asyxml><function type = "void" signature = "clipdraw(picture, Label, path, align, pen, arrowbar, arrowbar, real, real, Label, marker)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="clipdraw(picture,Label,path,align,pen,arrowbar,arrowbar,real,real,Label,marker)"><code></asyxml>*/
void clipdraw(picture pic = currentpicture, Label L = "", path g,
align align = NoAlign, pen p = currentpen,
arrowbar arrow = None, arrowbar bar = None,
@@ -1247,7 +1257,7 @@ void clipdraw(picture pic = currentpicture, Label L = "", path g,
});
}
-/*<asyxml><function type = "void" signature = "distance(picture pic, Label, point, point, bool, real, pen, pen, arrow)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="distance(picture pic,Label,point,point,bool,real,pen,pen,arrow)"><code></asyxml>*/
void distance(picture pic = currentpicture, Label L = "", point A, point B,
bool rotated = true, real offset = 3mm,
pen p = currentpen, pen joinpen = invisible,
@@ -1273,9 +1283,9 @@ void distance(picture pic = currentpicture, Label L = "", point A, point B,
pic.addBox(min(g), max(g), Tp * min(p), Tp * max(p));
}
-/*<asyxml><variable type = "real" signature = "perpfactor"><code></asyxml>*/
+/*<asyxml><variable type="real" signature="perpfactor"><code></asyxml>*/
real perpfactor = 1;/*<asyxml></code><documentation>Factor for drawing perpendicular symbol.</documentation></variable></asyxml>*/
-/*<asyxml><function type = "void" signature = "perpendicularmark(picture, point, explicit pair, explicit pair, real, pen, margin, filltype)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="perpendicularmark(picture,point,explicit pair,explicit pair,real,pen,margin,filltype)"><code></asyxml>*/
void perpendicularmark(picture pic = currentpicture, point z,
explicit pair align,
explicit pair dir = E, real size = 0,
@@ -1298,7 +1308,7 @@ void perpendicularmark(picture pic = currentpicture, point z,
add(pic, apic, locate(z));
}
-/*<asyxml><function type = "void" signature = "perpendicularmark(picture, point, vector, vector, real, pen, margin, filltype)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="perpendicularmark(picture,point,vector,vector,real,pen,margin,filltype)"><code></asyxml>*/
void perpendicularmark(picture pic = currentpicture, point z,
vector align,
vector dir = E, real size = 0,
@@ -1312,7 +1322,7 @@ void perpendicularmark(picture pic = currentpicture, point z,
p, margin, filltype);
}
-/*<asyxml><function type = "void" signature = "perpendicularmark(picture, point, explicit pair, path, real, pen, margin, filltype)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="perpendicularmark(picture,point,explicit pair,path,real,pen,margin,filltype)"><code></asyxml>*/
void perpendicularmark(picture pic = currentpicture, point z, explicit pair align, path g,
real size = 0, pen p = currentpen,
margin margin = NoMargin,
@@ -1323,7 +1333,7 @@ void perpendicularmark(picture pic = currentpicture, point z, explicit pair alig
perpendicularmark(pic, z, align, dir(g, 0), size, p, margin, filltype);
}
-/*<asyxml><function type = "void" signature = "perpendicularmark(picture, point, vector, path, real, pen, margin, filltype)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="perpendicularmark(picture,point,vector,path,real,pen,margin,filltype)"><code></asyxml>*/
void perpendicularmark(picture pic = currentpicture, point z, vector align, path g,
real size = 0, pen p = currentpen,
margin margin = NoMargin,
@@ -1334,7 +1344,7 @@ void perpendicularmark(picture pic = currentpicture, point z, vector align, path
perpendicularmark(pic, z, (pair)align, dir(g, 0), size, p, margin, filltype);
}
-/*<asyxml><function type = "void" signature = "markrightangle(picture, point, point, point, real, pen, margin, filltype)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="markrightangle(picture,point,point,point,real,pen,margin,filltype)"><code></asyxml>*/
void markrightangle(picture pic = currentpicture, point A, point O,
point B, real size = 0, pen p = currentpen,
margin margin = NoMargin,
@@ -1351,7 +1361,7 @@ void markrightangle(picture pic = currentpicture, point A, point O,
margin = margin, filltype = filltype);
}
-/*<asyxml><function type = "bool" signature = "simeq(point, point, real)"><code></asyxml>*/
+/*<asyxml><function type="bool" signature="simeq(point,point,real)"><code></asyxml>*/
bool simeq(point A, point B, real fuzz = epsgeo)
{/*<asyxml></code><documentation>Return true iff abs(A - B) < fuzz.
This routine is used internally to know if two points are equal, in particular by the operator == in 'point == point'.</documentation></function></asyxml>*/
@@ -1363,7 +1373,7 @@ bool simeq(point a, real b, real fuzz = epsgeo)
return (abs(a - point(R, ((pair)b)/R)) < fuzz);
}
-/*<asyxml><function type = "pair" signature = "attract(pair, path, real)"><code></asyxml>*/
+/*<asyxml><function type="pair" signature="attract(pair,path,real)"><code></asyxml>*/
pair attract(pair m, path g, real fuzz = 0)
{/*<asyxml></code><documentation>Return the nearest point (A PAIR) of 'm' which is on the path g.
'fuzz' is the argument 'fuzz' of 'intersect'.</documentation></function></asyxml>*/
@@ -1391,14 +1401,14 @@ pair attract(pair m, path g, real fuzz = 0)
return p;
}
-/*<asyxml><function type = "point" signature = "attract(point, path, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="attract(point,path,real)"><code></asyxml>*/
point attract(point M, path g, real fuzz = 0)
{/*<asyxml></code><documentation>Return the nearest point (A POINT) of 'M' which is on the path g.
'fuzz' is the argument 'fuzz' of 'intersect'.</documentation></function></asyxml>*/
return point(M.coordsys, attract(locate(M), g)/M.coordsys);
}
-/*<asyxml><function type = "real[]" signature = "intersect(path, explicit pair)"><code></asyxml>*/
+/*<asyxml><function type="real[]" signature="intersect(path,explicit pair)"><code></asyxml>*/
real[] intersect(path g, explicit pair p, real fuzz = 0)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
fuzz = fuzz <= 0 ? sqrt(realEpsilon) : fuzz;
@@ -1411,7 +1421,7 @@ real[] intersect(path g, explicit pair p, real fuzz = 0)
return or;
}
-/*<asyxml><function type = "real[]" signature = "intersect(path, explicit point)"><code></asyxml>*/
+/*<asyxml><function type="real[]" signature="intersect(path,explicit point)"><code></asyxml>*/
real[] intersect(path g, explicit point P, real fuzz = epsgeo)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
return intersect(g, locate(P), fuzz);
@@ -1421,18 +1431,18 @@ real[] intersect(path g, explicit point P, real fuzz = epsgeo)
// *=======================================================*
// *.........................LINES.........................*
-/*<asyxml><struct signature = "line"><code></asyxml>*/
+/*<asyxml><struct signature="line"><code></asyxml>*/
struct line
{/*<asyxml></code><documentation>This structure provides the objects line, semi - line and segment oriented from A to B.
All the calculus with this structure will be as exact as Asymptote can do.
For a full precision, you must not cast 'line' to 'path' excepted for drawing routines.</documentation></asyxml>*/
- /*<asyxml><property type = "point" signature = "A, B"><code></asyxml>*/
- restricted point A, B;/*<asyxml></code><documentation>Two line's points with same coordinate system.</documentation></property><property type = "bool" signature = "extendA, extendB"><code></asyxml>*/
- bool extendA, extendB;/*<asyxml></code><documentation>If true, extend 'l' in direction of A (resp. B).</documentation></property><property type = "vector" signature = "u, v"><code></asyxml>*/
- restricted vector u, v;/*<asyxml></code><documentation>u = unit(AB) = direction vector, v = normal vector.</documentation></property><property type = "real" signature = "a, b, c"><code></asyxml>*/
- restricted real a, b, c;/*<asyxml></code><documentation>Coefficients of the equation ax + by + c = 0 in the coordinate system of 'A'.</documentation></property><property type = "real" signature = "slope, origin"><code></asyxml>*/
+ /*<asyxml><property type = "point" signature="A,B"><code></asyxml>*/
+ restricted point A,B;/*<asyxml></code><documentation>Two line's points with same coordinate system.</documentation></property><property type = "bool" signature="extendA,extendB"><code></asyxml>*/
+ bool extendA,extendB;/*<asyxml></code><documentation>If true,extend 'l' in direction of A (resp. B).</documentation></property><property type = "vector" signature="u,v"><code></asyxml>*/
+ restricted vector u,v;/*<asyxml></code><documentation>u = unit(AB) = direction vector,v = normal vector.</documentation></property><property type = "real" signature="a,b,c"><code></asyxml>*/
+ restricted real a,b,c;/*<asyxml></code><documentation>Coefficients of the equation ax + by + c = 0 in the coordinate system of 'A'.</documentation></property><property type = "real" signature="slope,origin"><code></asyxml>*/
restricted real slope, origin;/*<asyxml></code><documentation>Slope and ordinate at the origin.</documentation></property></asyxml>*/
- /*<asyxml><method type = "line" signature = "copy()"><code></asyxml>*/
+ /*<asyxml><method type = "line" signature="copy()"><code></asyxml>*/
line copy()
{/*<asyxml></code><documentation>Copy a line in a new instance.</documentation></method></asyxml>*/
line l = new line;
@@ -1450,7 +1460,7 @@ struct line
return l;
}
- /*<asyxml><method type = "void" signature = "init(point, bool, point, bool)"><code></asyxml>*/
+ /*<asyxml><method type = "void" signature="init(point,bool,point,bool)"><code></asyxml>*/
void init(point A, bool extendA = true, point B, bool extendB = true)
{/*<asyxml></code><documentation>Initialize line.
If 'extendA' is true, the "line" is infinite in the direction of A.</documentation></method></asyxml>*/
@@ -1471,7 +1481,7 @@ struct line
}
}/*<asyxml></struct></asyxml>*/
-/*<asyxml><function type = "line" signature = "line(point, bool, point, bool)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="line(point,bool,point,bool)"><code></asyxml>*/
line line(point A, bool extendA = true, point B, bool extendB = true)
{/*<asyxml></code><documentation>Return the line passing through 'A' and 'B'.
If 'extendA' is true, the "line" is infinite in the direction of A.
@@ -1482,7 +1492,7 @@ line line(point A, bool extendA = true, point B, bool extendB = true)
return l;
}
-/*<asyxml><struct signature = "segment"><code></asyxml>*/
+/*<asyxml><struct signature="segment"><code></asyxml>*/
struct segment
{/*<asyxml></code><documentation><look href = "struct line"/>.</documentation></asyxml>*/
restricted point A, B;// Extremity.
@@ -1515,7 +1525,7 @@ struct segment
}
}/*<asyxml></struct></asyxml>*/
-/*<asyxml><function type = "segment" signature = "segment(point, point)"><code></asyxml>*/
+/*<asyxml><function type="segment" signature="segment(point,point)"><code></asyxml>*/
segment segment(point A, point B)
{/*<asyxml></code><documentation>Return the segment whose the extremities are A and B.</documentation></function></asyxml>*/
segment s;
@@ -1523,37 +1533,37 @@ segment segment(point A, point B)
return s;
}
-/*<asyxml><function type = "real" signature = "length(segment)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="length(segment)"><code></asyxml>*/
real length(segment s)
{/*<asyxml></code><documentation>Return the length of 's'.</documentation></function></asyxml>*/
return abs(s.A - s.B);
}
-/*<asyxml><operator type = "line" signature = "cast(segment)"><code></asyxml>*/
+/*<asyxml><operator type = "line" signature="cast(segment)"><code></asyxml>*/
line operator cast(segment s)
{/*<asyxml></code><documentation>A segment is casted to a "finite line".</documentation></operator></asyxml>*/
return line(s.A, false, s.B, false);
}
-/*<asyxml><operator type = "segment" signature = "cast(line)"><code></asyxml>*/
+/*<asyxml><operator type = "segment" signature="cast(line)"><code></asyxml>*/
segment operator cast(line l)
{/*<asyxml></code><documentation>Cast line 'l' to segment [l.A l.B].</documentation></operator></asyxml>*/
return segment(l.A, l.B);
}
-/*<asyxml><operator type = "line" signature = "*(transform, line)"><code></asyxml>*/
+/*<asyxml><operator type = "line" signature="*(transform,line)"><code></asyxml>*/
line operator *(transform t, line l)
{/*<asyxml></code><documentation>Provide transform * line</documentation></operator></asyxml>*/
return line(t * l.A, l.extendA, t * l.B, l.extendB);
}
-/*<asyxml><operator type = "line" signature = "/(line, real)"><code></asyxml>*/
+/*<asyxml><operator type = "line" signature="/(line,real)"><code></asyxml>*/
line operator /(line l, real x)
{/*<asyxml></code><documentation>Provide l/x.
Return the line passing through l.A/x and l.B/x.</documentation></operator></asyxml>*/
return line(l.A/x, l.extendA, l.B/x, l.extendB);
}
line operator /(line l, int x){return line(l.A/x, l.B/x);}
-/*<asyxml><operator type = "line" signature = "*(real, line)"><code></asyxml>*/
+/*<asyxml><operator type = "line" signature="*(real,line)"><code></asyxml>*/
line operator *(real x, line l)
{/*<asyxml></code><documentation>Provide x * l.
Return the line passing through x * l.A and x * l.B.</documentation></operator></asyxml>*/
@@ -1561,26 +1571,26 @@ line operator *(real x, line l)
}
line operator *(int x, line l){return line(x * l.A, l.extendA, x * l.B, l.extendB);}
-/*<asyxml><operator type = "line" signature = "*(point, line)"><code></asyxml>*/
+/*<asyxml><operator type = "line" signature="*(point,line)"><code></asyxml>*/
line operator *(point M, line l)
{/*<asyxml></code><documentation>Provide point * line.
Return the line passing through unit(M) * l.A and unit(M) * l.B.</documentation></operator></asyxml>*/
return line(unit(M) * l.A, l.extendA, unit(M) * l.B, l.extendB);
}
-/*<asyxml><operator type = "line" signature = "+(line, point)"><code></asyxml>*/
+/*<asyxml><operator type = "line" signature="+(line,point)"><code></asyxml>*/
line operator +(line l, vector u)
{/*<asyxml></code><documentation>Provide line + vector (and so line + point).
Return the line 'l' shifted by 'u'.</documentation></operator></asyxml>*/
return line(l.A + u, l.extendA, l.B + u, l.extendB);
}
-/*<asyxml><operator type = "line" signature = "-(line, vector)"><code></asyxml>*/
+/*<asyxml><operator type = "line" signature="-(line,vector)"><code></asyxml>*/
line operator -(line l, vector u)
{/*<asyxml></code><documentation>Provide line - vector (and so line - point).
Return the line 'l' shifted by '-u'.</documentation></operator></asyxml>*/
return line(l.A - u, l.extendA, l.B - u, l.extendB);
}
-/*<asyxml><operator type = "line[]" signature = "^^(line, line)"><code></asyxml>*/
+/*<asyxml><operator type = "line[]" signature="^^(line,line)"><code></asyxml>*/
line[] operator ^^(line l1, line l2)
{/*<asyxml></code><documentation>Provide line^^line.
Return the line array {l1, l2}.</documentation></operator></asyxml>*/
@@ -1589,7 +1599,7 @@ line[] operator ^^(line l1, line l2)
return ol;
}
-/*<asyxml><operator type = "line[]" signature = "^^(line, line[])"><code></asyxml>*/
+/*<asyxml><operator type = "line[]" signature="^^(line,line[])"><code></asyxml>*/
line[] operator ^^(line l1, line[] l2)
{/*<asyxml></code><documentation>Provide line^^line[].
Return the line array {l1, l2[0], l2[1]...}.
@@ -1608,7 +1618,7 @@ line[] operator ^^(line[] l2, line l1)
return ol;
}
-/*<asyxml><operator type = "line[]" signature = "^^(line, line[])"><code></asyxml>*/
+/*<asyxml><operator type = "line[]" signature="^^(line,line[])"><code></asyxml>*/
line[] operator ^^(line l1[], line[] l2)
{/*<asyxml></code><documentation>Provide line[]^^line[].
Return the line array {l1[0], l1[1], ..., l2[0], l2[1], ...}.</documentation></operator></asyxml>*/
@@ -1619,7 +1629,7 @@ line[] operator ^^(line l1[], line[] l2)
return ol;
}
-/*<asyxml><function type = "bool" signature = "sameside(point, point, line)"><code></asyxml>*/
+/*<asyxml><function type="bool" signature="sameside(point,point,line)"><code></asyxml>*/
bool sameside(point M, point P, line l)
{/*<asyxml></code><documentation>Return 'true' iff 'M' and 'N' are same side of the line (or on the line) 'l'.</documentation></function></asyxml>*/
pair A = l.A, B = l.B, m = M, p = P;
@@ -1634,26 +1644,26 @@ bool sameside(point M, point P, line l)
// return dot(locate(Mp - M), locate(Pp - P)) >= 0;
}
-/*<asyxml><function type = "line" signature = "line(segment)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="line(segment)"><code></asyxml>*/
line line(segment s)
{/*<asyxml></code><documentation>Return the line passing through 's.A'
and 's.B'.</documentation></function></asyxml>*/
return line(s.A, s.B);
}
-/*<asyxml><function type = "segment" signature = "segment(line)"><code></asyxml>*/
+/*<asyxml><function type="segment" signature="segment(line)"><code></asyxml>*/
segment segment(line l)
{/*<asyxml></code><documentation>Return the segment whose extremities
are 'l.A' and 'l.B'.</documentation></function></asyxml>*/
return segment(l.A, l.B);
}
-/*<asyxml><function type = "point" signature = "midpoint(segment)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="midpoint(segment)"><code></asyxml>*/
point midpoint(segment s)
{/*<asyxml></code><documentation>Return the midpoint of 's'.</documentation></function></asyxml>*/
return 0.5 * (s.A + s.B);
}
-/*<asyxml><function type = "void" signature = "write(line)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="write(line)"><code></asyxml>*/
void write(explicit line l)
{/*<asyxml></code><documentation>Write some informations about 'l'.</documentation></function></asyxml>*/
write("A = "+(string)((pair)l.A));
@@ -1669,7 +1679,7 @@ void write(explicit line l)
write("origin = "+(string) l.origin);
}
-/*<asyxml><function type = "void" signature = "write(explicit segment)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="write(explicit segment)"><code></asyxml>*/
void write(explicit segment s)
{/*<asyxml></code><documentation>Write some informations about 's'.</documentation></function></asyxml>*/
write("A = "+(string)((pair)s.A));
@@ -1683,7 +1693,7 @@ void write(explicit segment s)
write("origin = "+(string) s.origin);
}
-/*<asyxml><operator type = "bool" signature = "==(line, line)"><code></asyxml>*/
+/*<asyxml><operator type = "bool" signature="==(line,line)"><code></asyxml>*/
bool operator ==(line l1, line l2)
{/*<asyxml></code><documentation>Provide the test 'line == line'.</documentation></operator></asyxml>*/
return (collinear(l1.u, l2.u) &&
@@ -1691,13 +1701,13 @@ bool operator ==(line l1, line l2)
l1.extendA == l2.extendA && l1.extendB == l2.extendB);
}
-/*<asyxml><operator type = "bool" signature = "!=(line, line)"><code></asyxml>*/
+/*<asyxml><operator type = "bool" signature="!=(line,line)"><code></asyxml>*/
bool operator !=(line l1, line l2)
{/*<asyxml></code><documentation>Provide the test 'line != line'.</documentation></operator></asyxml>*/
return !(l1 == l2);
}
-/*<asyxml><operator type = "bool" signature = "@(point, line)"><code></asyxml>*/
+/*<asyxml><operator type = "bool" signature="@(point,line)"><code></asyxml>*/
bool operator @(point m, line l)
{/*<asyxml></code><documentation>Provide the test 'point @ line'.
Return true iff 'm' is on the 'l'.</documentation></operator></asyxml>*/
@@ -1709,19 +1719,19 @@ bool operator @(point m, line l)
return sameside(M, l.B, l.A);
}
-/*<asyxml><function type = "coordsys" signature = "coordsys(line)"><code></asyxml>*/
+/*<asyxml><function type="coordsys" signature="coordsys(line)"><code></asyxml>*/
coordsys coordsys(line l)
{/*<asyxml></code><documentation>Return the coordinate system in which 'l' is defined.</documentation></function></asyxml>*/
return l.A.coordsys;
}
-/*<asyxml><function type = "line" signature = "reverse(line)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="reverse(line)"><code></asyxml>*/
line reverse(line l)
{/*<asyxml></code><documentation>Permute the points 'A' and 'B' of 'l' and so its orientation.</documentation></function></asyxml>*/
return line(l.B, l.extendB, l.A, l.extendA);
}
-/*<asyxml><function type = "line" signature = "extend(line)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="extend(line)"><code></asyxml>*/
line extend(line l)
{/*<asyxml></code><documentation>Return the infinite line passing through 'l.A' and 'l.B'.</documentation></function></asyxml>*/
line ol = l.copy();
@@ -1730,7 +1740,7 @@ line extend(line l)
return ol;
}
-/*<asyxml><function type = "line" signature = "complementary(explicit line)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="complementary(explicit line)"><code></asyxml>*/
line complementary(explicit line l)
{/*<asyxml></code><documentation>Return the complementary of a half-line with respect of
the full line 'l'.</documentation></function></asyxml>*/
@@ -1742,7 +1752,7 @@ line complementary(explicit line l)
return line(origin, false, ptdir);
}
-/*<asyxml><function type = "line[]" signature = "complementary(explicit segment)"><code></asyxml>*/
+/*<asyxml><function type="line[]" signature="complementary(explicit segment)"><code></asyxml>*/
line[] complementary(explicit segment s)
{/*<asyxml></code><documentation>Return the two half-lines of origin 's.A' and 's.B' respectively.</documentation></function></asyxml>*/
line[] ol = new line[2];
@@ -1751,25 +1761,25 @@ line[] complementary(explicit segment s)
return ol;
}
-/*<asyxml><function type = "line" signature = "Ox(coordsys)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="Ox(coordsys)"><code></asyxml>*/
line Ox(coordsys R = currentcoordsys)
{/*<asyxml></code><documentation>Return the x-axis of 'R'.</documentation></function></asyxml>*/
return line(point(R, (0, 0)), point(R, E));
}
-/*<asyxml><constant type = "line" signature = "Ox"><code></asyxml>*/
+/*<asyxml><constant type = "line" signature="Ox"><code></asyxml>*/
restricted line Ox = Ox();/*<asyxml></code><documentation>the x-axis of
the default coordinate system.</documentation></constant></asyxml>*/
-/*<asyxml><function type = "line" signature = "Oy(coordsys)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="Oy(coordsys)"><code></asyxml>*/
line Oy(coordsys R = currentcoordsys)
{/*<asyxml></code><documentation>Return the y-axis of 'R'.</documentation></function></asyxml>*/
return line(point(R, (0, 0)), point(R, N));
}
-/*<asyxml><constant type = "line" signature = "Oy"><code></asyxml>*/
+/*<asyxml><constant type = "line" signature="Oy"><code></asyxml>*/
restricted line Oy = Oy();/*<asyxml></code><documentation>the y-axis of
the default coordinate system.</documentation></constant></asyxml>*/
-/*<asyxml><function type = "line" signature = "line(real, point)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="line(real,point)"><code></asyxml>*/
line line(real a, point A = point(currentcoordsys, (0, 0)))
{/*<asyxml></code><documentation>Return the line passing through 'A' with an
angle (in the coordinate system of A) 'a' in degrees.
@@ -1785,7 +1795,7 @@ line line(int a, point A = point(currentcoordsys, (0, 0)))
return line((real)a, A);
}
-/*<asyxml><function type = "line" signature = "line(coordsys, real, real)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="line(coordsys,real,real)"><code></asyxml>*/
line line(coordsys R = currentcoordsys, real slope, real origin)
{/*<asyxml></code><documentation>Return the line defined by slope and y-intercept relative to 'R'.</documentation></function></asyxml>*/
if (slope == infinity || slope == -infinity)
@@ -1793,7 +1803,7 @@ line line(coordsys R = currentcoordsys, real slope, real origin)
return line(point(R, (0, origin)), point(R, (1, origin + slope)));
}
-/*<asyxml><function type = "line" signature = "line(coordsys, real, real, real)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="line(coordsys,real,real,real)"><code></asyxml>*/
line line(coordsys R = currentcoordsys, real a, real b, real c)
{/*<asyxml></code><documentation>Retrun the line defined by equation relative to 'R'.</documentation></function></asyxml>*/
if (a == 0 && b == 0) abort("line: inconsistent equation...");
@@ -1802,29 +1812,29 @@ line line(coordsys R = currentcoordsys, real a, real b, real c)
return line(point(R, M), point(R, M + (-b, a)));
}
-/*<asyxml><function type = "line" signature = "vline(coordsys)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="vline(coordsys)"><code></asyxml>*/
line vline(coordsys R = currentcoordsys)
{/*<asyxml></code><documentation>Return a vertical line in 'R' passing through the origin of 'R'.</documentation></function></asyxml>*/
point P = point(R, (0, 0));
point PP = point(R, (R.O + N)/R);
return line(P, PP);
}
-/*<asyxml><constant type = "line" signature = "vline"><code></asyxml>*/
+/*<asyxml><constant type = "line" signature="vline"><code></asyxml>*/
restricted line vline = vline();/*<asyxml></code><documentation>The vertical line in the current coordinate system passing
through the origin of this system.</documentation></constant></asyxml>*/
-/*<asyxml><function type = "line" signature = "hline(coordsys)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="hline(coordsys)"><code></asyxml>*/
line hline(coordsys R = currentcoordsys)
{/*<asyxml></code><documentation>Return a horizontal line in 'R' passing through the origin of 'R'.</documentation></function></asyxml>*/
point P = point(R, (0, 0));
point PP = point(R, (R.O + E)/R);
return line(P, PP);
}
-/*<asyxml><constant type = "line" signature = "hline"><code></asyxml>*/
+/*<asyxml><constant type = "line" signature="hline"><code></asyxml>*/
line hline = hline();/*<asyxml></code><documentation>The horizontal line in the current coordinate system passing
through the origin of this system.</documentation></constant></asyxml>*/
-/*<asyxml><function type = "line" signature = "changecoordsys(coordsys, line)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="changecoordsys(coordsys,line)"><code></asyxml>*/
line changecoordsys(coordsys R, line l)
{/*<asyxml></code><documentation>Return the line 'l' in the coordinate system 'R'.</documentation></function></asyxml>*/
point A = changecoordsys(R, l.A);
@@ -1832,20 +1842,20 @@ line changecoordsys(coordsys R, line l)
return line(A, B);
}
-/*<asyxml><function type = "transform" signature = "scale(real, line, line, bool)"><code></asyxml>*/
+/*<asyxml><function type="transform" signature="scale(real,line,line,bool)"><code></asyxml>*/
transform scale(real k, line l1, line l2, bool safe = false)
{/*<asyxml></code><documentation>Return the dilatation with respect to
'l1' in the direction of 'l2'.</documentation></function></asyxml>*/
return scale(k, l1.A, l1.B, l2.A, l2.B, safe);
}
-/*<asyxml><function type = "transform" signature = "reflect(line)"><code></asyxml>*/
+/*<asyxml><function type="transform" signature="reflect(line)"><code></asyxml>*/
transform reflect(line l)
{/*<asyxml></code><documentation>Return the reflect about the line 'l'.</documentation></function></asyxml>*/
return reflect((pair)l.A, (pair)l.B);
}
-/*<asyxml><function type = "transform" signature = "reflect(line, line)"><code></asyxml>*/
+/*<asyxml><function type="transform" signature="reflect(line,line)"><code></asyxml>*/
transform reflect(line l1, line l2, bool safe = false)
{/*<asyxml></code><documentation>Return the reflect about the line
'l1' in the direction of 'l2'.</documentation></function></asyxml>*/
@@ -1853,7 +1863,7 @@ transform reflect(line l1, line l2, bool safe = false)
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(line, path)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(line,path)"><code></asyxml>*/
point[] intersectionpoints(line l, path g)
{/*<asyxml></code><documentation>Return all points of intersection of the line 'l' with the path 'g'.</documentation></function></asyxml>*/
// TODO utiliser la version 1.44 de intersections(path g, pair p, pair q)
@@ -1905,7 +1915,7 @@ point[] intersectionpoints(line l, path g)
return opp;
}
-/*<asyxml><function type = "point" signature = "intersectionpoint(line, line)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="intersectionpoint(line,line)"><code></asyxml>*/
point intersectionpoint(line l1, line l2)
{/*<asyxml></code><documentation>Return the point of intersection of line 'l1' with 'l2'.
If 'l1' and 'l2' have an infinity or none point of intersection,
@@ -1920,7 +1930,7 @@ point intersectionpoint(line l1, line l2)
return point(R, (infinity, infinity));
}
-/*<asyxml><function type = "line" signature = "parallel(point, line)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="parallel(point,line)"><code></asyxml>*/
line parallel(point M, line l)
{/*<asyxml></code><documentation>Return the line parallel to 'l' passing through 'M'.</documentation></function></asyxml>*/
point A, B;
@@ -1932,26 +1942,26 @@ line parallel(point M, line l)
return line(M, M - A + B);
}
-/*<asyxml><function type = "line" signature = "parallel(point, explicit vector)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="parallel(point,explicit vector)"><code></asyxml>*/
line parallel(point M, explicit vector dir)
{/*<asyxml></code><documentation>Return the line of direction 'dir' and passing through 'M'.</documentation></function></asyxml>*/
return line(M, M + locate(dir));
}
-/*<asyxml><function type = "line" signature = "parallel(point, explicit pair)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="parallel(point,explicit pair)"><code></asyxml>*/
line parallel(point M, explicit pair dir)
{/*<asyxml></code><documentation>Return the line of direction 'dir' and passing through 'M'.</documentation></function></asyxml>*/
return line(M, M + vector(currentcoordsys, dir));
}
-/*<asyxml><function type = "bool" signature = "parallel(line, line)"><code></asyxml>*/
+/*<asyxml><function type="bool" signature="parallel(line,line)"><code></asyxml>*/
bool parallel(line l1, line l2, bool strictly = false)
{/*<asyxml></code><documentation>Return 'true' if 'l1' and 'l2' are (strictly ?) parallel.</documentation></function></asyxml>*/
bool coll = collinear(l1.u, l2.u);
return strictly ? coll && (l1 != l2) : coll;
}
-/*<asyxml><function type = "bool" signature = "concurrent(...line[])"><code></asyxml>*/
+/*<asyxml><function type="bool" signature="concurrent(...line[])"><code></asyxml>*/
bool concurrent(... line[] l)
{/*<asyxml></code><documentation>Returns true if all the lines 'l' are concurrent.</documentation></function></asyxml>*/
if (l.length < 3) abort("'concurrent' needs at least for three lines ...");
@@ -1965,13 +1975,13 @@ bool concurrent(... line[] l)
return conc;
}
-/*<asyxml><function type = "transform" signature = "projection(line)"><code></asyxml>*/
+/*<asyxml><function type="transform" signature="projection(line)"><code></asyxml>*/
transform projection(line l)
{/*<asyxml></code><documentation>Return the orthogonal projection on 'l'.</documentation></function></asyxml>*/
return projection(l.A, l.B);
}
-/*<asyxml><function type = "transform" signature = "projection(line, line, bool)"><code></asyxml>*/
+/*<asyxml><function type="transform" signature="projection(line,line,bool)"><code></asyxml>*/
transform projection(line l1, line l2, bool safe = false)
{/*<asyxml></code><documentation>Return the projection on (AB) in parallel of (CD).
If 'safe = true' and (l1)//(l2) return the identity.
@@ -1979,7 +1989,7 @@ transform projection(line l1, line l2, bool safe = false)
return projection(l1.A, l1.B, l2.A, l2.B, safe);
}
-/*<asyxml><function type = "transform" signature = "vprojection(line, bool)"><code></asyxml>*/
+/*<asyxml><function type="transform" signature="vprojection(line,bool)"><code></asyxml>*/
transform vprojection(line l, bool safe = false)
{/*<asyxml></code><documentation>Return the projection on 'l' in parallel of N--S.
If 'safe' is 'true' the projected point keeps the same place if 'l'
@@ -1988,7 +1998,7 @@ transform vprojection(line l, bool safe = false)
return projection(l, line(point(R, N), point(R, S)), safe);
}
-/*<asyxml><function type = "transform" signature = "hprojection(line, bool)"><code></asyxml>*/
+/*<asyxml><function type="transform" signature="hprojection(line,bool)"><code></asyxml>*/
transform hprojection(line l, bool safe = false)
{/*<asyxml></code><documentation>Return the projection on 'l' in parallel of E--W.
If 'safe' is 'true' the projected point keeps the same place if 'l'
@@ -1997,7 +2007,7 @@ transform hprojection(line l, bool safe = false)
return projection(l, line(point(R, E), point(R, W)), safe);
}
-/*<asyxml><function type = "line" signature = "perpendicular(point, line)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="perpendicular(point,line)"><code></asyxml>*/
line perpendicular(point M, line l)
{/*<asyxml></code><documentation>Return the perpendicular line of 'l' passing through 'M'.</documentation></function></asyxml>*/
point Mp = projection(l) * M;
@@ -2005,41 +2015,41 @@ line perpendicular(point M, line l)
return line(Mp, rotate(90, Mp) * A);
}
-/*<asyxml><function type = "line" signature = "perpendicular(point, explicit vector)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="perpendicular(point,explicit vector)"><code></asyxml>*/
line perpendicular(point M, explicit vector normal)
{/*<asyxml></code><documentation>Return the line passing through 'M'
whose normal is \param{normal}.</documentation></function></asyxml>*/
return perpendicular(M, line(M, M + locate(normal)));
}
-/*<asyxml><function type = "line" signature = "perpendicular(point, explicit pair)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="perpendicular(point,explicit pair)"><code></asyxml>*/
line perpendicular(point M, explicit pair normal)
{/*<asyxml></code><documentation>Return the line passing through 'M'
whose normal is \param{normal} (given in the currentcoordsys).</documentation></function></asyxml>*/
return perpendicular(M, line(M, M + vector(currentcoordsys, normal)));
}
-/*<asyxml><function type = "bool" signature = "perpendicular(line, line)"><code></asyxml>*/
+/*<asyxml><function type="bool" signature="perpendicular(line,line)"><code></asyxml>*/
bool perpendicular(line l1, line l2)
{/*<asyxml></code><documentation>Return 'true' if 'l1' and 'l2' are perpendicular.</documentation></function></asyxml>*/
return abs(dot(locate(l1.u), locate(l2.u))) < epsgeo ;
}
-/*<asyxml><function type = "real" signature = "angle(line, coordsys)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="angle(line,coordsys)"><code></asyxml>*/
real angle(line l, coordsys R = coordsys(l))
{/*<asyxml></code><documentation>Return the angle of the oriented line 'l',
in radian, in the interval ]-pi, pi] and relatively to 'R'.</documentation></function></asyxml>*/
return angle(l.u, R, false);
}
-/*<asyxml><function type = "real" signature = "degrees(line, coordsys, bool)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="degrees(line,coordsys,bool)"><code></asyxml>*/
real degrees(line l, coordsys R = coordsys(l))
{/*<asyxml></code><documentation>Returns the angle of the oriented line 'l' in degrees,
in the interval [0, 360[ and relatively to 'R'.</documentation></function></asyxml>*/
return degrees(angle(l, R));
}
-/*<asyxml><function type = "real" signature = "sharpangle(line, line)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="sharpangle(line,line)"><code></asyxml>*/
real sharpangle(line l1, line l2)
{/*<asyxml></code><documentation>Return the measure in radians of the sharp angle formed by 'l1' and 'l2'.</documentation></function></asyxml>*/
vector u1 = l1.u;
@@ -2054,26 +2064,26 @@ real sharpangle(line l1, line l2)
return a12;
}
-/*<asyxml><function type = "real" signature = "angle(line, line)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="angle(line,line)"><code></asyxml>*/
real angle(line l1, line l2)
{/*<asyxml></code><documentation>Return the measure in radians of oriented angle (l1.u, l2.u).</documentation></function></asyxml>*/
return angle(locate(l2.u)) - angle(locate(l1.u));
}
-/*<asyxml><function type = "real" signature = "degrees(line, line)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="degrees(line,line)"><code></asyxml>*/
real degrees(line l1, line l2)
{/*<asyxml></code><documentation>Return the measure in degrees of the
angle formed by the oriented lines 'l1' and 'l2'.</documentation></function></asyxml>*/
return degrees(angle(l1, l2));
}
-/*<asyxml><function type = "real" signature = "sharpdegrees(line, line)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="sharpdegrees(line,line)"><code></asyxml>*/
real sharpdegrees(line l1, line l2)
{/*<asyxml></code><documentation>Return the measure in degrees of the sharp angle formed by 'l1' and 'l2'.</documentation></function></asyxml>*/
return degrees(sharpangle(l1, l2));
}
-/*<asyxml><function type = "line" signature = "bisector(line, line, real, bool)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="bisector(line,line,real,bool)"><code></asyxml>*/
line bisector(line l1, line l2, real angle = 0, bool sharp = true)
{/*<asyxml></code><documentation>Return the bisector of the angle formed by 'l1' and 'l2'
rotated by the angle 'angle' (in degrees) around intersection point of 'l1' with 'l2'.
@@ -2096,7 +2106,7 @@ line bisector(line l1, line l2, real angle = 0, bool sharp = true)
return ol;
}
-/*<asyxml><function type = "line" signature = "sector(int, int, line, line, real, bool)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="sector(int,int,line,line,real,bool)"><code></asyxml>*/
line sector(int n = 2, int p = 1, line l1, line l2, real angle = 0, bool sharp = true)
{/*<asyxml></code><documentation>Return the p-th nth-sector of the angle
formed by the oriented line 'l1' and 'l2'
@@ -2117,7 +2127,7 @@ line sector(int n = 2, int p = 1, line l1, line l2, real angle = 0, bool sharp =
return ol;
}
-/*<asyxml><function type = "line" signature = "bisector(point, point, point, point, real)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="bisector(point,point,point,point,real)"><code></asyxml>*/
line bisector(point A, point B, point C, point D, real angle = 0, bool sharp = true)
{/*<asyxml></code><documentation>Return the bisector of the angle formed by the lines (AB) and (CD).
<look href = "#bisector(line, line, real, bool)"/>.</documentation></function></asyxml>*/
@@ -2125,7 +2135,7 @@ line bisector(point A, point B, point C, point D, real angle = 0, bool sharp = t
return bisector(line(P[0], P[1]), line(P[2], P[3]), angle, sharp);
}
-/*<asyxml><function type = "line" signature = "bisector(segment, real)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="bisector(segment,real)"><code></asyxml>*/
line bisector(segment s, real angle = 0)
{/*<asyxml></code><documentation>Return the bisector of the segment line 's' rotated by 'angle' (in degrees) around the
midpoint of 's'.</documentation></function></asyxml>*/
@@ -2135,7 +2145,7 @@ line bisector(segment s, real angle = 0)
return rotate(angle, m) * line(m + dir, m - dir);
}
-/*<asyxml><function type = "line" signature = "bisector(point, point, real)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="bisector(point,point,real)"><code></asyxml>*/
line bisector(point A, point B, real angle = 0)
{/*<asyxml></code><documentation>Return the bisector of the segment line [AB] rotated by 'angle' (in degrees) around the
midpoint of [AB].</documentation></function></asyxml>*/
@@ -2143,7 +2153,7 @@ line bisector(point A, point B, real angle = 0)
return bisector(segment(P[0], P[1]), angle);
}
-/*<asyxml><function type = "real" signature = "distance(point, line)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="distance(point,line)"><code></asyxml>*/
real distance(point M, line l)
{/*<asyxml></code><documentation>Return the distance from 'M' to 'l'.
distance(line, point) is also defined.</documentation></function></asyxml>*/
@@ -2159,7 +2169,7 @@ real distance(line l, point M)
return distance(M, l);
}
-/*<asyxml><function type = "void" signature = "draw(picture, Label, line, bool, bool, align, pen, arrowbar, Label, marker)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="draw(picture,Label,line,bool,bool,align,pen,arrowbar,Label,marker)"><code></asyxml>*/
void draw(picture pic = currentpicture, Label L = "",
line l, bool dirA = l.extendA, bool dirB = l.extendB,
align align = NoAlign, pen p = currentpen,
@@ -2176,7 +2186,7 @@ void draw(picture pic = currentpicture, Label L = "",
legend, marker, pathModifier);
}
-/*<asyxml><function type = "void" signature = "draw(picture, Label[], line[], align, pen[], arrowbar, Label, marker)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="draw(picture,Label[], line[], align,pen[], arrowbar,Label,marker)"><code></asyxml>*/
void draw(picture pic = currentpicture, Label[] L = new Label[], line[] l,
align align = NoAlign, pen[] p = new pen[],
arrowbar arrow = None,
@@ -2191,7 +2201,7 @@ void draw(picture pic = currentpicture, Label[] L = new Label[], line[] l,
}
}
-/*<asyxml><function type = "void" signature = "draw(picture, Label[], line[], align, pen, arrowbar, Label, marker)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="draw(picture,Label[], line[], align,pen,arrowbar,Label,marker)"><code></asyxml>*/
void draw(picture pic = currentpicture, Label[] L = new Label[], line[] l,
align align = NoAlign, pen p,
arrowbar arrow = None,
@@ -2202,7 +2212,7 @@ void draw(picture pic = currentpicture, Label[] L = new Label[], line[] l,
draw(pic, L, l, align, tp, arrow, legend, marker, pathModifier);
}
-/*<asyxml><function type = "void" signature = "show(picture, line, pen)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="show(picture,line,pen)"><code></asyxml>*/
void show(picture pic = currentpicture, line l, pen p = red)
{/*<asyxml></code><documentation>Draw some informations of 'l'.</documentation></function></asyxml>*/
dot("$A$", (pair)l.A, align = -locate(l.v), p);
@@ -2212,7 +2222,7 @@ void show(picture pic = currentpicture, line l, pen p = red)
draw("$\vec{v}$", locate(l.A)--locate(l.A + l.v), p, Arrow);
}
-/*<asyxml><function type = "point[]" signature = "sameside(point, line, line)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="sameside(point,line,line)"><code></asyxml>*/
point[] sameside(point M, line l1, line l2)
{/*<asyxml></code><documentation>Return two points on 'l1' and 'l2' respectively.
The first point is from the same side of M relatively to 'l2',
@@ -2233,77 +2243,77 @@ point[] sameside(point M, line l1, line l2)
return op;
}
-// /*<asyxml><function type = "void" signature = "markangle(picture, Label, int, real, real, line, line, explicit pair, arrowbar, pen, filltype, margin, marker)"><code></asyxml>*/
-// void markangle(picture pic = currentpicture,
-// Label L = "", int n = 1, real radius = 0, real space = 0,
-// line l1, line l2, explicit pair align = dir(1),
-// arrowbar arrow = None, pen p = currentpen,
-// filltype filltype = NoFill,
-// margin margin = NoMargin, marker marker = nomarker)
-// {/*<asyxml></code><documentation>Mark the angle (l1, l2) aligned in the direction 'align' relative to 'l1'.
-// Commune values for 'align' are dir(real).</documentation></function></asyxml>*/
-// if (parallel(l1, l2, true)) return;
-// real al = degrees(l1, defaultcoordsys);
-// pair O, A, B;
-// if (radius == 0) radius = markangleradius(p);
-// real d = degrees(locate(l1.u));
-// align = rotate(d) * align;
-// if (l1 == l2) {
-// O = midpoint(segment(l1.A, l1.B));
-// A = l1.A;B = l1.B;
-// if (sameside(rotate(sgn(angle(B-A)) * 45, O) * A, O + align, l1)) {radius = -radius;}
-// } else {
-// O = intersectionpoint(extend(l1), extend(l2));
-// pair R = O + align;
-// point [] ss = sameside(point(coordsys(l1), R/coordsys(l1)), l1, l2);
-// A = ss[0];
-// B = ss[1];
-// }
-// markangle(pic = pic, L = L, n = n, radius = radius, space = space,
-// O = O, A = A, B = B,
-// arrow = arrow, p = p, filltype = filltype,
-// margin = margin, marker = marker);
-// }
-
-// /*<asyxml><function type = "void" signature = "markangle(picture, Label, int, real, real, line, line, explicit vector, arrowbar, pen, filltype, margin, marker)"><code></asyxml>*/
-// void markangle(picture pic = currentpicture,
-// Label L = "", int n = 1, real radius = 0, real space = 0,
-// line l1, line l2, explicit vector align,
-// arrowbar arrow = None, pen p = currentpen,
-// filltype filltype = NoFill,
-// margin margin = NoMargin, marker marker = nomarker)
-// {/*<asyxml></code><documentation>Mark the angle (l1, l2) in the direction 'dir' given relatively to 'l1'.</documentation></function></asyxml>*/
-// markangle(pic, L, n, radius, space, l1, l2, (pair)align, arrow,
-// p, filltype, margin, marker);
-// }
-
-/*<asyxml><function type = "void" signature = "markangle(picture, Label, int, real, real, line, line, arrowbar, pen, filltype, margin, marker)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="markangle(picture,Label,int,real,real,explicit line,explicit line,explicit pair,arrowbar,pen,filltype,margin,marker)"><code></asyxml>*/
void markangle(picture pic = currentpicture,
Label L = "", int n = 1, real radius = 0, real space = 0,
- line l1, line l2,
+ explicit line l1, explicit line l2, explicit pair align = dir(1),
arrowbar arrow = None, pen p = currentpen,
filltype filltype = NoFill,
margin margin = NoMargin, marker marker = nomarker)
-{/*<asyxml></code><documentation>Mark the oriented angle (l1, l2).</documentation></function></asyxml>*/
+{/*<asyxml></code><documentation>Mark the angle (l1, l2) aligned in the direction 'align' relative to 'l1'.
+ Commune values for 'align' are dir(real).</documentation></function></asyxml>*/
if (parallel(l1, l2, true)) return;
real al = degrees(l1, defaultcoordsys);
pair O, A, B;
if (radius == 0) radius = markangleradius(p);
real d = degrees(locate(l1.u));
+ align = rotate(d) * align;
if (l1 == l2) {
O = midpoint(segment(l1.A, l1.B));
+ A = l1.A;B = l1.B;
+ if (sameside(rotate(sgn(angle(B-A)) * 45, O) * A, O + align, l1)) {radius = -radius;}
} else {
O = intersectionpoint(extend(l1), extend(l2));
+ pair R = O + align;
+ point [] ss = sameside(point(coordsys(l1), R/coordsys(l1)), l1, l2);
+ A = ss[0];
+ B = ss[1];
}
- A = O + locate(l1.u);
- B = O + locate(l2.u);
markangle(pic = pic, L = L, n = n, radius = radius, space = space,
O = O, A = A, B = B,
arrow = arrow, p = p, filltype = filltype,
margin = margin, marker = marker);
}
-/*<asyxml><function type = "void" signature = "perpendicularmark(picture, line, line, real, pen, int, margin, filltype)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="markangle(picture,Label,int,real,real,explicit line,explicit line,explicit vector,arrowbar,pen,filltype,margin,marker)"><code></asyxml>*/
+void markangle(picture pic = currentpicture,
+ Label L = "", int n = 1, real radius = 0, real space = 0,
+ explicit line l1, explicit line l2, explicit vector align,
+ arrowbar arrow = None, pen p = currentpen,
+ filltype filltype = NoFill,
+ margin margin = NoMargin, marker marker = nomarker)
+{/*<asyxml></code><documentation>Mark the angle (l1, l2) in the direction 'dir' given relatively to 'l1'.</documentation></function></asyxml>*/
+ markangle(pic, L, n, radius, space, l1, l2, (pair)align, arrow,
+ p, filltype, margin, marker);
+}
+
+/*<asyxml><function type="void" signature="markangle(picture,Label,int,real,real,line,line,arrowbar,pen,filltype,margin,marker)"><code></asyxml>*/
+// void markangle(picture pic = currentpicture,
+// Label L = "", int n = 1, real radius = 0, real space = 0,
+// explicit line l1, explicit line l2,
+// arrowbar arrow = None, pen p = currentpen,
+// filltype filltype = NoFill,
+// margin margin = NoMargin, marker marker = nomarker)
+// {/*<asyxml></code><documentation>Mark the oriented angle (l1, l2).</documentation></function></asyxml>*/
+// if (parallel(l1, l2, true)) return;
+// real al = degrees(l1, defaultcoordsys);
+// pair O, A, B;
+// if (radius == 0) radius = markangleradius(p);
+// real d = degrees(locate(l1.u));
+// if (l1 == l2) {
+// O = midpoint(segment(l1.A, l1.B));
+// } else {
+// O = intersectionpoint(extend(l1), extend(l2));
+// }
+// A = O + locate(l1.u);
+// B = O + locate(l2.u);
+// markangle(pic = pic, L = L, n = n, radius = radius, space = space,
+// O = O, A = A, B = B,
+// arrow = arrow, p = p, filltype = filltype,
+// margin = margin, marker = marker);
+// }
+
+/*<asyxml><function type="void" signature="perpendicularmark(picture,line,line,real,pen,int,margin,filltype)"><code></asyxml>*/
void perpendicularmark(picture pic = currentpicture, line l1, line l2,
real size = 0, pen p = currentpen, int quarter = 1,
margin margin = NoMargin, filltype filltype = NoFill)
@@ -2319,15 +2329,15 @@ void perpendicularmark(picture pic = currentpicture, line l1, line l2,
// *=======================================================*
// *........................CONICS.........................*
-/*<asyxml><struct signature = "bqe"><code></asyxml>*/
+/*<asyxml><struct signature="bqe"><code></asyxml>*/
struct bqe
{/*<asyxml></code><documentation>Bivariate Quadratic Equation.</documentation></asyxml>*/
- /*<asyxml><property type = "real[]" signature = "a"><code></asyxml>*/
- real[] a;/*<asyxml></code><documentation>a[0] * x^2 + a[1] * x * y + a[2] * y^2 + a[3] * x + a[4] * y + a[5] = 0</documentation></property><property type = "coordsys" signature = "coordsys"><code></asyxml>*/
+ /*<asyxml><property type = "real[]" signature="a"><code></asyxml>*/
+ real[] a;/*<asyxml></code><documentation>a[0] * x^2 + a[1] * x * y + a[2] * y^2 + a[3] * x + a[4] * y + a[5] = 0</documentation></property><property type = "coordsys" signature="coordsys"><code></asyxml>*/
coordsys coordsys;/*<asyxml></code></property></asyxml>*/
}/*<asyxml></struct></asyxml>*/
-/*<asyxml><function type = "bqe" signature = "bqe(coordsys, real, real, real, real, real, real)"><code></asyxml>*/
+/*<asyxml><function type="bqe" signature="bqe(coordsys,real,real,real,real,real,real)"><code></asyxml>*/
bqe bqe(coordsys R = currentcoordsys,
real a, real b, real c, real d, real e, real f)
{/*<asyxml></code><documentation>Return the bivariate quadratic equation
@@ -2339,7 +2349,7 @@ bqe bqe(coordsys R = currentcoordsys,
return obqe;
}
-/*<asyxml><function type = "bqe" signature = "changecoordsys(coordsys, bqe)"><code></asyxml>*/
+/*<asyxml><function type="bqe" signature="changecoordsys(coordsys,bqe)"><code></asyxml>*/
bqe changecoordsys(coordsys R, bqe bqe)
{/*<asyxml></code><documentation>Returns the bivariate quadratic equation relatively to 'R'.</documentation></function></asyxml>*/
pair i = coordinates(changecoordsys(R, vector(defaultcoordsys,
@@ -2372,7 +2382,7 @@ bqe changecoordsys(coordsys R, bqe bqe)
return obqe;
}
-/*<asyxml><function type = "bqe" signature = "bqe(point, point, point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="bqe" signature="bqe(point,point,point,point,point)"><code></asyxml>*/
bqe bqe(point M1, point M2, point M3, point M4, point M5)
{/*<asyxml></code><documentation>Return the bqe of conic passing through the five points (if possible).</documentation></function></asyxml>*/
coordsys R;
@@ -2407,7 +2417,7 @@ bqe bqe(point M1, point M2, point M3, point M4, point M5)
return bqe;
}
-/*<asyxml><function type = "bool" signature = "samecoordsys(bool...bqe[])"><code></asyxml>*/
+/*<asyxml><function type="bool" signature="samecoordsys(bool...bqe[])"><code></asyxml>*/
bool samecoordsys(bool warn = true ... bqe[] bqes)
{/*<asyxml></code><documentation>Return true if all the bivariate quadratic equations have the same coordinate system.</documentation></function></asyxml>*/
bool ret = true;
@@ -2425,7 +2435,7 @@ system.");
return ret;
}
-/*<asyxml><function type = "real[]" signature = "realquarticroots(real, real, real, real, real)"><code></asyxml>*/
+/*<asyxml><function type="real[]" signature="realquarticroots(real,real,real,real,real)"><code></asyxml>*/
real[] realquarticroots(real a, real b, real c, real d, real e)
{/*<asyxml></code><documentation>Return the real roots of the quartic equation ax^4 + b^x3 + cx^2 + dx = 0.</documentation></function></asyxml>*/
static real Fuzz = sqrt(realEpsilon);
@@ -2469,7 +2479,7 @@ real[] realquarticroots(real a, real b, real c, real d, real e)
return roots;
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(bqe, bqe)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(bqe,bqe)"><code></asyxml>*/
point[] intersectionpoints(bqe bqe1, bqe bqe2)
{/*<asyxml></code><documentation>Return the interscetion of the two conic sections whose equations are 'bqe1' and 'bqe2'.</documentation></function></asyxml>*/
coordsys R = bqe1.coordsys;
@@ -2544,13 +2554,13 @@ point[] intersectionpoints(bqe bqe1, bqe bqe2)
return P;
}
-/*<asyxml><struct signature = "conic"><code></asyxml>*/
+/*<asyxml><struct signature="conic"><code></asyxml>*/
struct conic
-{/*<asyxml></code><documentation></documentation><property type = "real" signature = "e, p, h"><code></asyxml>*/
+{/*<asyxml></code><documentation></documentation><property type = "real" signature="e,p,h"><code></asyxml>*/
real e, p, h;/*<asyxml></code><documentation>BE CAREFUL: h = distance(F, D) and p = h * e (http://en.wikipedia.org/wiki/Ellipse)
- While http://mathworld.wolfram.com/ takes p = distance(F, D).</documentation></property><property type = "point" signature = "F"><code></asyxml>*/
- point F;/*<asyxml></code><documentation>Focus.</documentation></property><property type = "line" signature = "D"><code></asyxml>*/
- line D;/*<asyxml></code><documentation>Directrix.</documentation></property><property type = "line" signature = "l"><code></asyxml>*/
+ While http://mathworld.wolfram.com/ takes p = distance(F,D).</documentation></property><property type = "point" signature="F"><code></asyxml>*/
+ point F;/*<asyxml></code><documentation>Focus.</documentation></property><property type = "line" signature="D"><code></asyxml>*/
+ line D;/*<asyxml></code><documentation>Directrix.</documentation></property><property type = "line" signature="l"><code></asyxml>*/
line[] l;/*<asyxml></code><documentation>Case of degenerated conic (not yet implemented !).</documentation></property></asyxml>*/
}/*<asyxml></struct></asyxml>*/
@@ -2582,11 +2592,11 @@ conic conic(point F, line l, real e)
return oc;
}
-/*<asyxml><struct signature = "circle"><code></asyxml>*/
+/*<asyxml><struct signature="circle"><code></asyxml>*/
struct circle
{/*<asyxml></code><documentation>All the calculus with this structure will be as exact as Asymptote can do.
For a full precision, you must not cast 'circle' to 'path' excepted for drawing routines.</documentation></asyxml>*/
- /*<asyxml><property type = "point" signature = "C"><code></asyxml>*/
+ /*<asyxml><property type = "point" signature="C"><code></asyxml>*/
point C;/*<asyxml></code><documentation>Center</documentation></property><property><code></asyxml>*/
real r;/*<asyxml></code><documentation>Radius</documentation></property><property><code></asyxml>*/
line l;/*<asyxml></code><documentation>If the radius is infinite, this line is used instead of circle.</documentation></property></asyxml>*/
@@ -2602,16 +2612,16 @@ line line(circle c){
return c.l;
}
-/*<asyxml><struct signature = "ellipse"><code></asyxml>*/
+/*<asyxml><struct signature="ellipse"><code></asyxml>*/
struct ellipse
{/*<asyxml></code><documentation>Look at <html><a href = "http://mathworld.wolfram.com/Ellipse.html">http://mathworld.wolfram.com/Ellipse.html</a></html></documentation></asyxml>*/
- /*<asyxml><property type = "point" signature = "F1, F2, C"><code></asyxml>*/
- restricted point F1, F2, C;/*<asyxml></code><documentation>Foci and center.</documentation></property><property type = "real" signature = "a, b, c, e, p"><code></asyxml>*/
- restricted real a, b, c, e, p;/*<asyxml></code></property><property type = "real" signature = "angle"><code></asyxml>*/
- restricted real angle;/*<asyxml></code><documentation>Value is degrees(F1 - F2).</documentation></property><property type = "line" signature = "D1, D2"><code></asyxml>*/
- restricted line D1, D2;/*<asyxml></code><documentation>Directrices.</documentation></property><property type = "line" signature = "l"><code></asyxml>*/
+ /*<asyxml><property type = "point" signature="F1,F2,C"><code></asyxml>*/
+ restricted point F1,F2,C;/*<asyxml></code><documentation>Foci and center.</documentation></property><property type = "real" signature="a,b,c,e,p"><code></asyxml>*/
+ restricted real a,b,c,e,p;/*<asyxml></code></property><property type = "real" signature="angle"><code></asyxml>*/
+ restricted real angle;/*<asyxml></code><documentation>Value is degrees(F1 - F2).</documentation></property><property type = "line" signature="D1,D2"><code></asyxml>*/
+ restricted line D1,D2;/*<asyxml></code><documentation>Directrices.</documentation></property><property type = "line" signature="l"><code></asyxml>*/
line l;/*<asyxml></code><documentation>If one axis is infinite, this line is used instead of ellipse.</documentation></property></asyxml>*/
- /*<asyxml><method type = "void" signature = "init(point, point, real)"><code></asyxml>*/
+ /*<asyxml><method type = "void" signature="init(point,point,real)"><code></asyxml>*/
void init(point f1, point f2, real a)
{/*<asyxml></code><documentation>Ellipse given by foci and semimajor axis</documentation></method></asyxml>*/
point[] P = standardizecoordsys(f1, f2);
@@ -2645,17 +2655,17 @@ bool degenerate(ellipse el)
return (!finite(el.a) || !finite(el.b));
}
-/*<asyxml><struct signature = "parabola"><code></asyxml>*/
+/*<asyxml><struct signature="parabola"><code></asyxml>*/
struct parabola
-{/*<asyxml></code><documentation>Look at <html><a href = "http://mathworld.wolfram.com/Parabola.html">http://mathworld.wolfram.com/Parabola.html</a></html></documentation><property type = "point" signature = "F, V"><code></asyxml>*/
- restricted point F, V;/*<asyxml></code><documentation>Focus and vertex</documentation></property><property type = "real" signature = "a, p, e = 1"><code></asyxml>*/
- restricted real a, p, e = 1;/*<asyxml></code></property><property type = "real" signature = "angle"><code></asyxml>*/
- restricted real angle;/*<asyxml></code><documentation>Angle, in degrees, of the line (FV).</documentation></property><property type = "line" signature = "D"><code></asyxml>*/
- restricted line D;/*<asyxml></code><documentation>Directrix</documentation></property><property type = "pair" signature = "bmin, bmax"><code></asyxml>*/
+{/*<asyxml></code><documentation>Look at <html><a href = "http://mathworld.wolfram.com/Parabola.html">http://mathworld.wolfram.com/Parabola.html</a></html></documentation><property type = "point" signature="F,V"><code></asyxml>*/
+ restricted point F,V;/*<asyxml></code><documentation>Focus and vertex</documentation></property><property type = "real" signature="a,p,e = 1"><code></asyxml>*/
+ restricted real a,p,e = 1;/*<asyxml></code></property><property type = "real" signature="angle"><code></asyxml>*/
+ restricted real angle;/*<asyxml></code><documentation>Angle, in degrees, of the line (FV).</documentation></property><property type = "line" signature="D"><code></asyxml>*/
+ restricted line D;/*<asyxml></code><documentation>Directrix</documentation></property><property type = "pair" signature="bmin,bmax"><code></asyxml>*/
pair bmin, bmax;/*<asyxml></code><documentation>The (left, bottom) and (right, top) coordinates of region bounding box for drawing the parabola.
If unset the current picture bounding box is used instead.</documentation></property></asyxml>*/
- /*<asyxml><method type = "void" signature = "init(point, line)"><code></asyxml>*/
+ /*<asyxml><method type = "void" signature="init(point,line)"><code></asyxml>*/
void init(point F, line directrix)
{/*<asyxml></code><documentation>Parabola given by focus and directrix.</documentation></method></asyxml>*/
point[] P = standardizecoordsys(F, directrix.A, directrix.B);
@@ -2669,18 +2679,18 @@ struct parabola
}
}/*<asyxml></struct></asyxml>*/
-/*<asyxml><struct signature = "hyperbola"><code></asyxml>*/
+/*<asyxml><struct signature="hyperbola"><code></asyxml>*/
struct hyperbola
-{/*<asyxml></code><documentation><html>Look at <a href = "http://mathworld.wolfram.com/Hyperbola.html">http://mathworld.wolfram.com/Hyperbola.html</a></html></documentation><property type = "point" signature = "F1, F2"><code></asyxml>*/
- restricted point F1, F2;/*<asyxml></code><documentation>Foci.</documentation></property><property type = "point" signature = "C, V1, V2"><code></asyxml>*/
- restricted point C, V1, V2;/*<asyxml></code><documentation>Center and vertices.</documentation></property><property type = "real" signature = "a, b, c, e, p"><code></asyxml>*/
- restricted real a, b, c, e, p;/*<asyxml></code><documentation></documentation></property><property type = "real" signature = "angle"><code></asyxml>*/
- restricted real angle;/*<asyxml></code><documentation>Angle, in degrees, of the line (F1F2).</documentation></property><property type = "line" signature = "D1, D2, A1, A2"><code></asyxml>*/
- restricted line D1, D2, A1, A2;/*<asyxml></code><documentation>Directrices and asymptotes.</documentation></property><property type = "pair" signature = "bmin, bmax"><code></asyxml>*/
+{/*<asyxml></code><documentation><html>Look at <a href = "http://mathworld.wolfram.com/Hyperbola.html">http://mathworld.wolfram.com/Hyperbola.html</a></html></documentation><property type = "point" signature="F1,F2"><code></asyxml>*/
+ restricted point F1,F2;/*<asyxml></code><documentation>Foci.</documentation></property><property type = "point" signature="C,V1,V2"><code></asyxml>*/
+ restricted point C,V1,V2;/*<asyxml></code><documentation>Center and vertices.</documentation></property><property type = "real" signature="a,b,c,e,p"><code></asyxml>*/
+ restricted real a,b,c,e,p;/*<asyxml></code><documentation></documentation></property><property type = "real" signature="angle"><code></asyxml>*/
+ restricted real angle;/*<asyxml></code><documentation>Angle,in degrees,of the line (F1F2).</documentation></property><property type = "line" signature="D1,D2,A1,A2"><code></asyxml>*/
+ restricted line D1,D2,A1,A2;/*<asyxml></code><documentation>Directrices and asymptotes.</documentation></property><property type = "pair" signature="bmin,bmax"><code></asyxml>*/
pair bmin, bmax; /*<asyxml></code><documentation>The (left, bottom) and (right, top) coordinates of region bounding box for drawing the hyperbola.
If unset the current picture bounding box is used instead.</documentation></property></asyxml>*/
- /*<asyxml><method type = "void" signature = "init(point, point, real)"><code></asyxml>*/
+ /*<asyxml><method type = "void" signature="init(point,point,real)"><code></asyxml>*/
void init(point f1, point f2, real a)
{/*<asyxml></code><documentation>Hyperbola given by foci and semimajor axis.</documentation></method></asyxml>*/
point[] P = standardizecoordsys(f1, f2);
@@ -2704,12 +2714,12 @@ struct hyperbola
}
}/*<asyxml></struct></asyxml>*/
-/*<asyxml><variable type = "int" signature = "conicnodesfactor"><code></asyxml>*/
+/*<asyxml><variable type="int" signature="conicnodesfactor"><code></asyxml>*/
int conicnodesfactor = 1;/*<asyxml></code><documentation>Factor for the node number of all conics.</documentation></variable></asyxml>*/
-/*<asyxml><variable type = "int" signature = "circlenodesnumberfactor"><code></asyxml>*/
+/*<asyxml><variable type="int" signature="circlenodesnumberfactor"><code></asyxml>*/
int circlenodesnumberfactor = 100;/*<asyxml></code><documentation>Factor for the node number of circles.</documentation></variable></asyxml>*/
-/*<asyxml><function type = "int" signature = "circlenodesnumber(real)"><code></asyxml>*/
+/*<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)
@@ -2720,7 +2730,7 @@ int circlenodesnumber(real r)
return oi == 0 ? 4 : conicnodesfactor * oi;
}
-/*<asyxml><function type = "int" signature = "circlenodesnumber(real, real, real)"><code></asyxml>*/
+/*<asyxml><function type="int" signature="circlenodesnumber(real,real,real)"><code></asyxml>*/
int circlenodesnumber(real r, real angle1, real angle2)
{/*<asyxml></code><documentation>Return the number of nodes to draw a circle arc.</documentation></function></asyxml>*/
return (r > 0) ?
@@ -2728,9 +2738,9 @@ int circlenodesnumber(real r, real angle1, real angle2)
ceil(circlenodesnumber(r) * abs((1 - abs(angle1 - angle2)/360)));
}
-/*<asyxml><variable type = "int" signature = "ellispenodesnumberfactor"><code></asyxml>*/
+/*<asyxml><variable type="int" signature="ellispenodesnumberfactor"><code></asyxml>*/
int ellipsenodesnumberfactor = 250;/*<asyxml></code><documentation>Factor for the node number of ellispe (non-circle).</documentation></variable></asyxml>*/
-/*<asyxml><function type = "int" signature = "ellipsenodesnumber(real, real)"><code></asyxml>*/
+/*<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)
@@ -2743,7 +2753,7 @@ int ellipsenodesnumber(real a, real b)
return conicnodesfactor * oi;
}
-/*<asyxml><function type = "int" signature = "ellipsenodesnumber(real, real, real)"><code></asyxml>*/
+/*<asyxml><function type="int" signature="ellipsenodesnumber(real,real,real)"><code></asyxml>*/
int ellipsenodesnumber(real a, real b, real angle1, real angle2, bool dir)
{/*<asyxml></code><documentation>Return the number of nodes to draw an ellipse arc.</documentation></function></asyxml>*/
real d;
@@ -2757,62 +2767,62 @@ int ellipsenodesnumber(real a, real b, real angle1, real angle2, bool dir)
return n < 5 ? 5 : n;
}
-/*<asyxml><variable type = "int" signature = "parabolanodesnumberfactor"><code></asyxml>*/
+/*<asyxml><variable type="int" signature="parabolanodesnumberfactor"><code></asyxml>*/
int parabolanodesnumberfactor = 100;/*<asyxml></code><documentation>Factor for the number of nodes of parabolas.</documentation></variable></asyxml>*/
-/*<asyxml><function type = "int" signature = "parabolanodesnumber(parabola, real, real)"><code></asyxml>*/
+/*<asyxml><function type="int" signature="parabolanodesnumber(parabola,real,real)"><code></asyxml>*/
int parabolanodesnumber(parabola p, real angle1, real angle2)
{/*<asyxml></code><documentation>Return the number of nodes for drawing a parabola.</documentation></function></asyxml>*/
return conicnodesfactor * floor(0.01 * parabolanodesnumberfactor * abs(angle1 - angle2));
}
-/*<asyxml><variable type = "int" signature = "hyperbolanodesnumberfactor"><code></asyxml>*/
+/*<asyxml><variable type="int" signature="hyperbolanodesnumberfactor"><code></asyxml>*/
int hyperbolanodesnumberfactor = 100;/*<asyxml></code><documentation>Factor for the number of nodes of hyperbolas.</documentation></variable></asyxml>*/
-/*<asyxml><function type = "int" signature = "hyperbolanodesnumber(hyperbola, real, real)"><code></asyxml>*/
+/*<asyxml><function type="int" signature="hyperbolanodesnumber(hyperbola,real,real)"><code></asyxml>*/
int hyperbolanodesnumber(hyperbola h, real angle1, real angle2)
{/*<asyxml></code><documentation>Return the number of nodes for drawing an hyperbola.</documentation></function></asyxml>*/
return conicnodesfactor * floor(0.01 * hyperbolanodesnumberfactor * abs(angle1 - angle2)/h.e);
}
-/*<asyxml><operator type = "conic" signature = "+(conic, explicit point)"><code></asyxml>*/
+/*<asyxml><operator type = "conic" signature="+(conic,explicit point)"><code></asyxml>*/
conic operator +(conic c, explicit point M)
{/*<asyxml></code><documentation></documentation></operator></asyxml>*/
return conic(c.F + M, c.D + M, c.e);
}
-/*<asyxml><operator type = "conic" signature = "-(conic, explicit point)"><code></asyxml>*/
+/*<asyxml><operator type = "conic" signature="-(conic,explicit point)"><code></asyxml>*/
conic operator -(conic c, explicit point M)
{/*<asyxml></code><documentation></documentation></operator></asyxml>*/
return conic(c.F - M, c.D - M, c.e);
}
-/*<asyxml><operator type = "conic" signature = "+(conic, explicit pair)"><code></asyxml>*/
+/*<asyxml><operator type = "conic" signature="+(conic,explicit pair)"><code></asyxml>*/
conic operator +(conic c, explicit pair m)
{/*<asyxml></code><documentation></documentation></operator></asyxml>*/
point M = point(c.F.coordsys, m);
return conic(c.F + M, c.D + M, c.e);
}
-/*<asyxml><operator type = "conic" signature = "-(conic, explicit pair)"><code></asyxml>*/
+/*<asyxml><operator type = "conic" signature="-(conic,explicit pair)"><code></asyxml>*/
conic operator -(conic c, explicit pair m)
{/*<asyxml></code><documentation></documentation></operator></asyxml>*/
point M = point(c.F.coordsys, m);
return conic(c.F - M, c.D - M, c.e);
}
-/*<asyxml><operator type = "conic" signature = "+(conic, vector)"><code></asyxml>*/
+/*<asyxml><operator type = "conic" signature="+(conic,vector)"><code></asyxml>*/
conic operator +(conic c, vector v)
{/*<asyxml></code><documentation></documentation></operator></asyxml>*/
return conic(c.F + v, c.D + v, c.e);
}
-/*<asyxml><operator type = "conic" signature = "-(conic, vector)"><code></asyxml>*/
+/*<asyxml><operator type = "conic" signature="-(conic,vector)"><code></asyxml>*/
conic operator -(conic c, vector v)
{/*<asyxml></code><documentation></documentation></operator></asyxml>*/
return conic(c.F - v, c.D - v, c.e);
}
-/*<asyxml><function type = "coordsys" signature = "coordsys(conic)"><code></asyxml>*/
+/*<asyxml><function type="coordsys" signature="coordsys(conic)"><code></asyxml>*/
coordsys coordsys(conic co)
{/*<asyxml></code><documentation>Return the coordinate system of 'co'.</documentation></function></asyxml>*/
return co.F.coordsys;
}
-/*<asyxml><function type = "conic" signature = "changecoordsys(coordsys, conic)"><code></asyxml>*/
+/*<asyxml><function type="conic" signature="changecoordsys(coordsys,conic)"><code></asyxml>*/
conic changecoordsys(coordsys R, conic co)
{/*<asyxml></code><documentation>Change the coordinate system of 'co' to 'R'</documentation></function></asyxml>*/
line l = changecoordsys(R, co.D);
@@ -2823,7 +2833,7 @@ conic changecoordsys(coordsys R, conic co)
/*<asyxml><typedef type = "polarconicroutine" return = "path" params = "conic, real, real, int, bool"><code></asyxml>*/
typedef path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction);/*<asyxml></code><documentation>Routine type used to draw conics from 'angle1' to 'angle2'</documentation></typedef></asyxml>*/
-/*<asyxml><function type = "path" signature = "arcfromfocus(conic, real, real, int, bool)"><code></asyxml>*/
+/*<asyxml><function type="path" signature="arcfromfocus(conic,real,real,int,bool)"><code></asyxml>*/
path arcfromfocus(conic co, real angle1, real angle2, int n = 400, bool direction = CCW)
{/*<asyxml></code><documentation>Return the path of the conic section 'co' from angle1 to angle2 in degrees,
drawing in the given direction, with n nodes.</documentation></function></asyxml>*/
@@ -2859,10 +2869,10 @@ path arcfromfocus(conic co, real angle1, real angle2, int n = 400, bool directio
return (direction ? op : op == nullpath ? op :reverse(op));
}
-/*<asyxml><variable type = "polarconicroutine" signature = "currentpolarconicroutine"><code></asyxml>*/
+/*<asyxml><variable type="polarconicroutine" signature="currentpolarconicroutine"><code></asyxml>*/
polarconicroutine currentpolarconicroutine = arcfromfocus;/*<asyxml></code><documentation>Default routine used to cast conic section to path.</documentation></variable></asyxml>*/
-/*<asyxml><function type = "point" signature = "angpoint(conic, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="angpoint(conic,real)"><code></asyxml>*/
point angpoint(conic co, real angle)
{/*<asyxml></code><documentation>Return the point of 'co' whose the angular (in degrees)
coordinate is 'angle' (mesured from the focus of 'co', relatively
@@ -2871,20 +2881,20 @@ point angpoint(conic co, real angle)
return point(R, point(arcfromfocus(co, angle, angle, 1, CCW), 0)/R);
}
-/*<asyxml><operator type = "bool" signature = "@(point, conic)"><code></asyxml>*/
+/*<asyxml><operator type = "bool" signature="@(point,conic)"><code></asyxml>*/
bool operator @(point M, conic co)
{/*<asyxml></code><documentation>Return true iff 'M' on 'co'.</documentation></operator></asyxml>*/
if(co.e == 0) return abs(abs(co.F - M) - co.p) < 10 * epsgeo;
return abs(co.e * distance(M, co.D) - abs(co.F - M)) < 10 * epsgeo;
}
-/*<asyxml><function type = "coordsys" signature = "coordsys(ellipse)"><code></asyxml>*/
+/*<asyxml><function type="coordsys" signature="coordsys(ellipse)"><code></asyxml>*/
coordsys coordsys(ellipse el)
{/*<asyxml></code><documentation>Return the coordinate system of 'el'.</documentation></function></asyxml>*/
return el.F1.coordsys;
}
-/*<asyxml><function type = "coordsys" signature = "canonicalcartesiansystem(ellipse)"><code></asyxml>*/
+/*<asyxml><function type="coordsys" signature="canonicalcartesiansystem(ellipse)"><code></asyxml>*/
coordsys canonicalcartesiansystem(ellipse el)
{/*<asyxml></code><documentation>Return the canonical cartesian system of the ellipse 'el'.</documentation></function></asyxml>*/
if(degenerate(el)) return cartesiansystem(el.l.A, el.l.u, el.l.v);
@@ -2894,7 +2904,7 @@ coordsys canonicalcartesiansystem(ellipse el)
return cartesiansystem(O, i, j);
}
-/*<asyxml><function type = "coordsys" signature = "canonicalcartesiansystem(parabola)"><code></asyxml>*/
+/*<asyxml><function type="coordsys" signature="canonicalcartesiansystem(parabola)"><code></asyxml>*/
coordsys canonicalcartesiansystem(parabola p)
{/*<asyxml></code><documentation>Return the canonical cartesian system of a parabola,
so that Origin = vertex of 'p' and directrix: x = -a.</documentation></function></asyxml>*/
@@ -2905,7 +2915,7 @@ coordsys canonicalcartesiansystem(parabola p)
return cartesiansystem(O, i, j);
}
-/*<asyxml><function type = "coordsys" signature = "canonicalcartesiansystem(hyperbola)"><code></asyxml>*/
+/*<asyxml><function type="coordsys" signature="canonicalcartesiansystem(hyperbola)"><code></asyxml>*/
coordsys canonicalcartesiansystem(hyperbola h)
{/*<asyxml></code><documentation>Return the canonical cartesian system of an hyperbola.</documentation></function></asyxml>*/
pair O = locate(h.C);
@@ -2914,7 +2924,7 @@ coordsys canonicalcartesiansystem(hyperbola h)
return cartesiansystem(O, i, j);
}
-/*<asyxml><function type = "ellipse" signature = "ellipse(point, point, real)"><code></asyxml>*/
+/*<asyxml><function type="ellipse" signature="ellipse(point,point,real)"><code></asyxml>*/
ellipse ellipse(point F1, point F2, real a)
{/*<asyxml></code><documentation>Return the ellipse whose the foci are 'F1' and 'F2'
and the semimajor axis is 'a'.</documentation></function></asyxml>*/
@@ -2923,10 +2933,10 @@ ellipse ellipse(point F1, point F2, real a)
return oe;
}
-/*<asyxml><constant type = "bool" signature = "byfoci, byvertices"><code></asyxml>*/
+/*<asyxml><constant type = "bool" signature="byfoci,byvertices"><code></asyxml>*/
restricted bool byfoci = true, byvertices = false;/*<asyxml></code><documentation>Constants useful for the routine 'hyperbola(point P1, point P2, real ae, bool byfoci = byfoci)'</documentation></constant></asyxml>*/
-/*<asyxml><function type = "hyperbola" signature = "hyperbola(point, point, real, bool)"><code></asyxml>*/
+/*<asyxml><function type="hyperbola" signature="hyperbola(point,point,real,bool)"><code></asyxml>*/
hyperbola hyperbola(point P1, point P2, real ae, bool byfoci = byfoci)
{/*<asyxml></code><documentation>if 'byfoci = true':
return the hyperbola whose the foci are 'P1' and 'P2'
@@ -2946,7 +2956,7 @@ hyperbola hyperbola(point P1, point P2, real ae, bool byfoci = byfoci)
return oh;
}
-/*<asyxml><function type = "ellipse" signature = "ellipse(point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="ellipse" signature="ellipse(point,point,point)"><code></asyxml>*/
ellipse ellipse(point F1, point F2, point M)
{/*<asyxml></code><documentation>Return the ellipse passing through 'M' whose the foci are 'F1' and 'F2'.</documentation></function></asyxml>*/
point P[] = standardizecoordsys(false, F1, F2, M);
@@ -2954,7 +2964,7 @@ ellipse ellipse(point F1, point F2, point M)
return ellipse(F1, F2, finite(a) ? a/2 : a);
}
-/*<asyxml><function type = "ellipse" signature = "ellipse(point, real, real, real)"><code></asyxml>*/
+/*<asyxml><function type="ellipse" signature="ellipse(point,real,real,real)"><code></asyxml>*/
ellipse ellipse(point C, real a, real b, real angle = 0)
{/*<asyxml></code><documentation>Return the ellipse centered at 'C' with semimajor axis 'a' along C--C + dir(angle),
semiminor axis 'b' along the perpendicular.</documentation></function></asyxml>*/
@@ -2979,7 +2989,7 @@ ellipse ellipse(point C, real a, real b, real angle = 0)
return oe;
}
-/*<asyxml><function type = "ellipse" signature = "ellipse(bqe)"><code></asyxml>*/
+/*<asyxml><function type="ellipse" signature="ellipse(bqe)"><code></asyxml>*/
ellipse ellipse(bqe bqe)
{/*<asyxml></code><documentation>Return the ellipse a[0] * x^2 + a[1] * xy + a[2] * y^2 + a[3] * x + a[4] * y + a[5] = 0
given in the coordinate system of 'bqe' with a[i] = bque.a[i].
@@ -3019,25 +3029,25 @@ ellipse ellipse(bqe bqe)
a, b, degrees(pi/2 - dir - angle(R.i)));
}
-/*<asyxml><function type = "ellipse" signature = "ellipse(point, point, point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="ellipse" signature="ellipse(point,point,point,point,point)"><code></asyxml>*/
ellipse ellipse(point M1, point M2, point M3, point M4, point M5)
{/*<asyxml></code><documentation>Return the ellipse passing through the five points (if possible)</documentation></function></asyxml>*/
return ellipse(bqe(M1, M2, M3, M4, M5));
}
-/*<asyxml><function type = "bool" signature = "inside(ellipse, point)"><code></asyxml>*/
+/*<asyxml><function type="bool" signature="inside(ellipse,point)"><code></asyxml>*/
bool inside(ellipse el, point M)
{/*<asyxml></code><documentation>Return 'true' iff 'M' is inside 'el'.</documentation></function></asyxml>*/
return abs(el.F1 - M) + abs(el.F2 - M) - 2 * el.a < -epsgeo;
}
-/*<asyxml><function type = "bool" signature = "inside(parabola, point)"><code></asyxml>*/
+/*<asyxml><function type="bool" signature="inside(parabola,point)"><code></asyxml>*/
bool inside(parabola p, point M)
{/*<asyxml></code><documentation>Return 'true' if 'M' is inside 'p'.</documentation></function></asyxml>*/
return distance(p.D, M) - abs(p.F - M) > epsgeo;
}
-/*<asyxml><function type = "parabola" signature = "parabola(point, line)"><code></asyxml>*/
+/*<asyxml><function type="parabola" signature="parabola(point,line)"><code></asyxml>*/
parabola parabola(point F, line l)
{/*<asyxml></code><documentation>Return the parabola whose focus is 'F' and directrix is 'l'.</documentation></function></asyxml>*/
parabola op;
@@ -3045,7 +3055,7 @@ parabola parabola(point F, line l)
return op;
}
-/*<asyxml><function type = "parabola" signature = "parabola(point, point)"><code></asyxml>*/
+/*<asyxml><function type="parabola" signature="parabola(point,point)"><code></asyxml>*/
parabola parabola(point F, point vertex)
{/*<asyxml></code><documentation>Return the parabola whose focus is 'F' and vertex is 'vertex'.</documentation></function></asyxml>*/
parabola op;
@@ -3056,7 +3066,7 @@ parabola parabola(point F, point vertex)
return op;
}
-/*<asyxml><function type = "parabola" signature = "parabola(point, real, real)"><code></asyxml>*/
+/*<asyxml><function type="parabola" signature="parabola(point,real,real)"><code></asyxml>*/
parabola parabola(point F, real a, real angle)
{/*<asyxml></code><documentation>Return the parabola whose focus is F, latus rectum is 4a and
the angle of the axis of symmetry (in the coordinate system of F) is 'angle'.</documentation></function></asyxml>*/
@@ -3068,7 +3078,7 @@ parabola parabola(point F, real a, real angle)
return op;
}
-/*<asyxml><function type = "bool" signature = "isparabola(bqe)"><code></asyxml>*/
+/*<asyxml><function type="bool" signature="isparabola(bqe)"><code></asyxml>*/
bool isparabola(bqe bqe)
{/*<asyxml></code><documentation>Return true iff 'bqe' is the equation of a parabola.</documentation></function></asyxml>*/
bqe lbqe = changecoordsys(defaultcoordsys, bqe);
@@ -3077,7 +3087,7 @@ bool isparabola(bqe bqe)
return (abs(delta) > epsgeo && abs(b^2 - a * c) < epsgeo);
}
-/*<asyxml><function type = "parabola" signature = "parabola(bqe)"><code></asyxml>*/
+/*<asyxml><function type="parabola" signature="parabola(bqe)"><code></asyxml>*/
parabola parabola(bqe bqe)
{/*<asyxml></code><documentation>Return the parabola a[0]x^2 + a[1]xy + a[2]y^2 + a[3]x + a[4]y + a[5]] = 0 (a[n] means bqe.a[n]).
<url href = "http://mathworld.wolfram.com/QuadraticCurve.html"/>
@@ -3119,7 +3129,7 @@ parabola parabola(bqe bqe)
return op;
}
-/*<asyxml><function type = "parabola" signature = "parabola(point, point, point, line)"><code></asyxml>*/
+/*<asyxml><function type="parabola" signature="parabola(point,point,point,line)"><code></asyxml>*/
parabola parabola(point M1, point M2, point M3, line l)
{/*<asyxml></code><documentation>Return the parabola passing through the three points with its directix
parallel to the line 'l'.</documentation></function></asyxml>*/
@@ -3145,13 +3155,13 @@ parabola parabola(point M1, point M2, point M3, line l)
return parabola(changecoordsys(R, bqe(Rp, 1, 0, 0, coef[0], coef[1], coef[2])));
}
-/*<asyxml><function type = "parabola" signature = "parabola(point, point, point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="parabola" signature="parabola(point,point,point,point,point)"><code></asyxml>*/
parabola parabola(point M1, point M2, point M3, point M4, point M5)
{/*<asyxml></code><documentation>Return the parabola passing through the five points.</documentation></function></asyxml>*/
return parabola(bqe(M1, M2, M3, M4, M5));
}
-/*<asyxml><function type = "hyperbola" signature = "hyperbola(point, real, real, real)"><code></asyxml>*/
+/*<asyxml><function type="hyperbola" signature="hyperbola(point,real,real,real)"><code></asyxml>*/
hyperbola hyperbola(point C, real a, real b, real angle = 0)
{/*<asyxml></code><documentation>Return the hyperbola centered at 'C' with semimajor axis 'a' along C--C + dir(angle),
semiminor axis 'b' along the perpendicular.</documentation></function></asyxml>*/
@@ -3165,7 +3175,7 @@ hyperbola hyperbola(point C, real a, real b, real angle = 0)
return oh;
}
-/*<asyxml><function type = "hyperbola" signature = "hyperbola(bqe)"><code></asyxml>*/
+/*<asyxml><function type="hyperbola" signature="hyperbola(bqe)"><code></asyxml>*/
hyperbola hyperbola(bqe bqe)
{/*<asyxml></code><documentation>Return the hyperbola a[0]x^2 + a[1]xy + a[2]y^2 + a[3]x + a[4]y + a[5]] = 0 (a[n] means bqe.a[n]).
<url href = "http://mathworld.wolfram.com/QuadraticCurve.html"/>
@@ -3192,19 +3202,19 @@ hyperbola hyperbola(bqe bqe)
return hyperbola(C, a, b, degrees(-dir - angle(R.i)));
}
-/*<asyxml><function type = "hyperbola" signature = "hyperbola(point, point, point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="hyperbola" signature="hyperbola(point,point,point,point,point)"><code></asyxml>*/
hyperbola hyperbola(point M1, point M2, point M3, point M4, point M5)
{/*<asyxml></code><documentation>Return the hyperbola passing through the five points (if possible).</documentation></function></asyxml>*/
return hyperbola(bqe(M1, M2, M3, M4, M5));
}
-/*<asyxml><function type = "hyperbola" signature = "conj(hyperbola)"><code></asyxml>*/
+/*<asyxml><function type="hyperbola" signature="conj(hyperbola)"><code></asyxml>*/
hyperbola conj(hyperbola h)
{/*<asyxml></code><documentation>Conjugate.</documentation></function></asyxml>*/
return hyperbola(h.C, h.b, h.a, 90 + h.angle);
}
-/*<asyxml><function type = "circle" signature = "circle(explicit point, real)"><code></asyxml>*/
+/*<asyxml><function type="circle" signature="circle(explicit point,real)"><code></asyxml>*/
circle circle(explicit point C, real r)
{/*<asyxml></code><documentation>Circle given by center and radius.</documentation></function></asyxml>*/
circle oc = new circle;
@@ -3214,7 +3224,7 @@ circle circle(explicit point C, real r)
return oc;
}
-/*<asyxml><function type = "circle" signature = "circle(point, point)"><code></asyxml>*/
+/*<asyxml><function type="circle" signature="circle(point,point)"><code></asyxml>*/
circle circle(point A, point B)
{/*<asyxml></code><documentation>Return the circle of diameter AB.</documentation></function></asyxml>*/
real r;
@@ -3234,13 +3244,13 @@ circle circle(point A, point B)
return oc;
}
-/*<asyxml><function type = "circle" signature = "circle(segment)"><code></asyxml>*/
+/*<asyxml><function type="circle" signature="circle(segment)"><code></asyxml>*/
circle circle(segment s)
{/*<asyxml></code><documentation>Return the circle of diameter 's'.</documentation></function></asyxml>*/
return circle(s.A, s.B);
}
-/*<asyxml><function type = "point" signature = "circumcenter(point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="circumcenter(point,point,point)"><code></asyxml>*/
point circumcenter(point A, point B, point C)
{/*<asyxml></code><documentation>Return the circumcenter of triangle ABC.</documentation></function></asyxml>*/
point[] P = standardizecoordsys(A, B, C);
@@ -3252,7 +3262,7 @@ point circumcenter(point A, point B, point C)
return point(R, pp/R);
}
-/*<asyxml><function type = "circle" signature = "circle(point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="circle" signature="circle(point,point,point)"><code></asyxml>*/
circle circle(point A, point B, point C)
{/*<asyxml></code><documentation>Return the circumcircle of the triangle ABC.</documentation></function></asyxml>*/
if(collinear(A - B, A - C)) {
@@ -3266,13 +3276,13 @@ circle circle(point A, point B, point C)
return circle(c, abs(c - A));
}
-/*<asyxml><function type = "circle" signature = "circumcircle(point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="circle" signature="circumcircle(point,point,point)"><code></asyxml>*/
circle circumcircle(point A, point B, point C)
{/*<asyxml></code><documentation>Return the circumcircle of the triangle ABC.</documentation></function></asyxml>*/
return circle(A, B, C);
}
-/*<asyxml><operator type = "circle" signature = "*(real, explicit circle)"><code></asyxml>*/
+/*<asyxml><operator type = "circle" signature="*(real,explicit circle)"><code></asyxml>*/
circle operator *(real x, explicit circle c)
{/*<asyxml></code><documentation>Multiply the radius of 'c'.</documentation></operator></asyxml>*/
return finite(c.r) ? circle(c.C, x * c.r) : c;
@@ -3281,7 +3291,7 @@ circle operator *(int x, explicit circle c)
{
return finite(c.r) ? circle(c.C, x * c.r) : c;
}
-/*<asyxml><operator type = "circle" signature = "/(explicit circle, real)"><code></asyxml>*/
+/*<asyxml><operator type = "circle" signature="/(explicit circle,real)"><code></asyxml>*/
circle operator /(explicit circle c, real x)
{/*<asyxml></code><documentation>Divide the radius of 'c'</documentation></operator></asyxml>*/
return finite(c.r) ? circle(c.C, c.r/x) : c;
@@ -3290,44 +3300,44 @@ circle operator /(explicit circle c, int x)
{
return finite(c.r) ? circle(c.C, c.r/x) : c;
}
-/*<asyxml><operator type = "circle" signature = "+(explicit circle, explicit point)"><code></asyxml>*/
+/*<asyxml><operator type = "circle" signature="+(explicit circle,explicit point)"><code></asyxml>*/
circle operator +(explicit circle c, explicit point M)
{/*<asyxml></code><documentation>Translation of 'c'.</documentation></operator></asyxml>*/
return circle(c.C + M, c.r);
}
-/*<asyxml><operator type = "circle" signature = "-(explicit circle, explicit point)"><code></asyxml>*/
+/*<asyxml><operator type = "circle" signature="-(explicit circle,explicit point)"><code></asyxml>*/
circle operator -(explicit circle c, explicit point M)
{/*<asyxml></code><documentation>Translation of 'c'.</documentation></operator></asyxml>*/
return circle(c.C - M, c.r);
}
-/*<asyxml><operator type = "circle" signature = "+(explicit circle, pair)"><code></asyxml>*/
+/*<asyxml><operator type = "circle" signature="+(explicit circle,pair)"><code></asyxml>*/
circle operator +(explicit circle c, pair m)
{/*<asyxml></code><documentation>Translation of 'c'.
'm' represent coordinates in the coordinate system where 'c' is defined.</documentation></operator></asyxml>*/
return circle(c.C + m, c.r);
}
-/*<asyxml><operator type = "circle" signature = "-(explicit circle, pair)"><code></asyxml>*/
+/*<asyxml><operator type = "circle" signature="-(explicit circle,pair)"><code></asyxml>*/
circle operator -(explicit circle c, pair m)
{/*<asyxml></code><documentation>Translation of 'c'.
'm' represent coordinates in the coordinate system where 'c' is defined.</documentation></operator></asyxml>*/
return circle(c.C - m, c.r);
}
-/*<asyxml><operator type = "circle" signature = "+(explicit circle, vector)"><code></asyxml>*/
+/*<asyxml><operator type = "circle" signature="+(explicit circle,vector)"><code></asyxml>*/
circle operator +(explicit circle c, vector m)
{/*<asyxml></code><documentation>Translation of 'c'.</documentation></operator></asyxml>*/
return circle(c.C + m, c.r);
}
-/*<asyxml><operator type = "circle" signature = "-(explicit circle, vector)"><code></asyxml>*/
+/*<asyxml><operator type = "circle" signature="-(explicit circle,vector)"><code></asyxml>*/
circle operator -(explicit circle c, vector m)
{/*<asyxml></code><documentation>Translation of 'c'.</documentation></operator></asyxml>*/
return circle(c.C - m, c.r);
}
-/*<asyxml><operator type = "real" signature = "^(point, explicit circle)"><code></asyxml>*/
+/*<asyxml><operator type = "real" signature="^(point,explicit circle)"><code></asyxml>*/
real operator ^(point M, explicit circle c)
{/*<asyxml></code><documentation>The power of 'M' with respect to the circle 'c'</documentation></operator></asyxml>*/
return xpart((abs(locate(M) - locate(c.C)), c.r)^2);
}
-/*<asyxml><operator type = "bool" signature = "@(point, explicit circle)"><code></asyxml>*/
+/*<asyxml><operator type = "bool" signature="@(point,explicit circle)"><code></asyxml>*/
bool operator @(point M, explicit circle c)
{/*<asyxml></code><documentation>Return true iff 'M' is on the circle 'c'.</documentation></operator></asyxml>*/
return finite(c.r) ?
@@ -3335,13 +3345,13 @@ bool operator @(point M, explicit circle c)
M @ c.l;
}
-/*<asyxml><operator type = "ellipse" signature = "cast(circle)"><code></asyxml>*/
+/*<asyxml><operator type = "ellipse" signature="cast(circle)"><code></asyxml>*/
ellipse operator cast(circle c)
{/*<asyxml></code><documentation></documentation></operator></asyxml>*/
return finite(c.r) ? ellipse(c.C, c.r, c.r, 0) : ellipse(c.l.A, c.l.B, infinity);
}
-/*<asyxml><operator type = "circle" signature = "cast(ellipse)"><code></asyxml>*/
+/*<asyxml><operator type = "circle" signature="cast(ellipse)"><code></asyxml>*/
circle operator cast(ellipse el)
{/*<asyxml></code><documentation></documentation></operator></asyxml>*/
circle oc;
@@ -3353,7 +3363,7 @@ circle operator cast(ellipse el)
return oc;
}
-/*<asyxml><operator type = "ellipse" signature = "cast(conic)"><code></asyxml>*/
+/*<asyxml><operator type = "ellipse" signature="cast(conic)"><code></asyxml>*/
ellipse operator cast(conic co)
{/*<asyxml></code><documentation>Cast a conic to an ellipse (can be a circle).</documentation></operator></asyxml>*/
if(degenerate(co) && co.e < 1) return ellipse(co.l[0].A, co.l[0].B, infinity);
@@ -3371,7 +3381,7 @@ ellipse operator cast(conic co)
return oe;
}
-/*<asyxml><operator type = "parabola" signature = "cast(conic)"><code></asyxml>*/
+/*<asyxml><operator type = "parabola" signature="cast(conic)"><code></asyxml>*/
parabola operator cast(conic co)
{/*<asyxml></code><documentation>Cast a conic to a parabola.</documentation></operator></asyxml>*/
parabola op;
@@ -3380,13 +3390,13 @@ parabola operator cast(conic co)
return op;
}
-/*<asyxml><operator type = "conic" signature = "cast(parabola)"><code></asyxml>*/
+/*<asyxml><operator type = "conic" signature="cast(parabola)"><code></asyxml>*/
conic operator cast(parabola p)
{/*<asyxml></code><documentation>Cast a parabola to a conic section.</documentation></operator></asyxml>*/
return conic(p.F, p.D, 1);
}
-/*<asyxml><operator type = "hyperbola" signature = "cast(conic)"><code></asyxml>*/
+/*<asyxml><operator type = "hyperbola" signature="cast(conic)"><code></asyxml>*/
hyperbola operator cast(conic co)
{/*<asyxml></code><documentation>Cast a conic section to an hyperbola.</documentation></operator></asyxml>*/
hyperbola oh;
@@ -3403,13 +3413,13 @@ hyperbola operator cast(conic co)
return oh;
}
-/*<asyxml><operator type = "conic" signature = "cast(hyperbola)"><code></asyxml>*/
+/*<asyxml><operator type = "conic" signature="cast(hyperbola)"><code></asyxml>*/
conic operator cast(hyperbola h)
{/*<asyxml></code><documentation>Hyperbola to conic section.</documentation></operator></asyxml>*/
return conic(h.F1, h.D1, h.e);
}
-/*<asyxml><operator type = "conic" signature = "cast(ellipse)"><code></asyxml>*/
+/*<asyxml><operator type = "conic" signature="cast(ellipse)"><code></asyxml>*/
conic operator cast(ellipse el)
{/*<asyxml></code><documentation>Ellipse to conic section.</documentation></operator></asyxml>*/
conic oc;
@@ -3432,13 +3442,13 @@ conic operator cast(ellipse el)
return oc;
}
-/*<asyxml><operator type = "conic" signature = "cast(circle)"><code></asyxml>*/
+/*<asyxml><operator type = "conic" signature="cast(circle)"><code></asyxml>*/
conic operator cast(circle c)
{/*<asyxml></code><documentation>Circle to conic section.</documentation></operator></asyxml>*/
return (conic)((ellipse)c);
}
-/*<asyxml><operator type = "circle" signature = "cast(conic)"><code></asyxml>*/
+/*<asyxml><operator type = "circle" signature="cast(conic)"><code></asyxml>*/
circle operator cast(conic c)
{/*<asyxml></code><documentation>Conic section to circle.</documentation></operator></asyxml>*/
ellipse el = (ellipse)c;
@@ -3451,7 +3461,7 @@ circle operator cast(conic c)
return oc;
}
-/*<asyxml><operator type = "ellipse" signature = "*(transform, ellipse)"><code></asyxml>*/
+/*<asyxml><operator type = "ellipse" signature="*(transform,ellipse)"><code></asyxml>*/
ellipse operator *(transform t, ellipse el)
{/*<asyxml></code><documentation>Provide transform * ellipse.</documentation></operator></asyxml>*/
if(!degenerate(el)) {
@@ -3466,7 +3476,7 @@ ellipse operator *(transform t, ellipse el)
return ellipse(t * el.l.A, t * el.l.B, infinity);
}
-/*<asyxml><operator type = "parabola" signature = "*(transform, parabola)"><code></asyxml>*/
+/*<asyxml><operator type = "parabola" signature="*(transform,parabola)"><code></asyxml>*/
parabola operator *(transform t, parabola p)
{/*<asyxml></code><documentation>Provide transform * parabola.</documentation></operator></asyxml>*/
point[] P;
@@ -3480,7 +3490,7 @@ parabola operator *(transform t, parabola p)
return op;
}
-/*<asyxml><operator type = "ellipse" signature = "*(transform, circle)"><code></asyxml>*/
+/*<asyxml><operator type = "ellipse" signature="*(transform,circle)"><code></asyxml>*/
ellipse operator *(transform t, circle c)
{/*<asyxml></code><documentation>Provide transform * circle.
For example, 'circle C = scale(2) * circle' and 'ellipse E = xscale(2) * circle' are valid
@@ -3488,7 +3498,7 @@ ellipse operator *(transform t, circle c)
return t * ((ellipse)c);
}
-/*<asyxml><operator type = "hyperbola" signature = "*(transform, hyperbola)"><code></asyxml>*/
+/*<asyxml><operator type = "hyperbola" signature="*(transform,hyperbola)"><code></asyxml>*/
hyperbola operator *(transform t, hyperbola h)
{/*<asyxml></code><documentation>Provide transform * hyperbola.</documentation></operator></asyxml>*/
if (t == identity()) {
@@ -3511,7 +3521,7 @@ hyperbola operator *(transform t, hyperbola h)
return oe;
}
-/*<asyxml><operator type = "conic" signature = "*(transform, conic)"><code></asyxml>*/
+/*<asyxml><operator type = "conic" signature="*(transform,conic)"><code></asyxml>*/
conic operator *(transform t, conic co)
{/*<asyxml></code><documentation>Provide transform * conic.</documentation></operator></asyxml>*/
if(co.e < 1) return (t * ((ellipse)co));
@@ -3519,58 +3529,58 @@ conic operator *(transform t, conic co)
return (t * ((hyperbola)co));
}
-/*<asyxml><operator type = "ellipse" signature = "*(real, ellipse)"><code></asyxml>*/
+/*<asyxml><operator type = "ellipse" signature="*(real,ellipse)"><code></asyxml>*/
ellipse operator *(real x, ellipse el)
{/*<asyxml></code><documentation>Identical but more efficient (rapid) than 'scale(x, el.C) * el'.</documentation></operator></asyxml>*/
return degenerate(el) ? el : ellipse(el.C, x * el.a, x * el.b, el.angle);
}
-/*<asyxml><operator type = "ellipse" signature = "/(ellipse, real)"><code></asyxml>*/
+/*<asyxml><operator type = "ellipse" signature="/(ellipse,real)"><code></asyxml>*/
ellipse operator /(ellipse el, real x)
{/*<asyxml></code><documentation>Identical but more efficient (rapid) than 'scale(1/x, el.C) * el'.</documentation></operator></asyxml>*/
return degenerate(el) ? el : ellipse(el.C, el.a/x, el.b/x, el.angle);
}
-/*<asyxml><function type = "path" signature = "arcfromcenter(ellipse, real, real, int, bool)"><code></asyxml>*/
+/*<asyxml><function type="path" signature="arcfromcenter(ellipse,real,real,int,bool)"><code></asyxml>*/
path arcfromcenter(ellipse el, real angle1, real angle2,
- bool direction = CCW,
- int n = ellipsenodesnumber(el.a, el.b, angle1, angle2, direction))
+ bool direction=CCW,
+ int n=ellipsenodesnumber(el.a,el.b,angle1,angle2,direction))
{/*<asyxml></code><documentation>Return the path of the ellipse 'el' from angle1 to angle2 in degrees,
drawing in the given direction, with n nodes.
- The angles are mesured relatively to the axis (C, x-axis) where C is
+ The angles are mesured relatively to the axis (C,x-axis) where C is
the center of the ellipse.</documentation></function></asyxml>*/
if(degenerate(el)) abort("arcfromcenter: can not convert degenerated ellipse to path.");
if (angle1 > angle2)
return reverse(arcfromcenter(el, angle2, angle1, !direction, n));
- path op;
- coordsys Rp = coordsys(el);
+
+ guide op;
+ coordsys Rp=coordsys(el);
if (n < 1) return op;
+
interpolate join = operator ..;
real stretch = max(el.a/el.b, el.b/el.a);
+
if (stretch > 10) {
n *= floor(stretch/5);
join = operator --;
}
+
real a1 = direction ? radians(angle1) : radians(angle2);
real a2 = direction ? radians(angle2) : radians(angle1) + 2 * pi;
- real step = (a2 - a1)/(n != 1 ? n - 1 : 1);
+ real step=(a2 - a1)/(n != 1 ? n-1 : 1);
real a, r;
real da = radians(el.angle);
- real a3 = angle((cos(a1)/el.a, sin(a1)/el.b));
- real a3 = (a3>=0) ? a3 : a3 + 2pi;
- real a4 = angle((cos(a2)/el.a, sin(a2)/el.b));
- real a4 = (a4>=0) ? a4 : a4 + 2pi;
- real step = (a4 - a3)/(n != 1 ? n - 1 : 1);
- for (int i = 0; i < n; ++i) {
- a = a3 + i * step;
- a = angle((el.a * cos(a), el.b * sin(a)));
+
+ for (int i=0; i < n; ++i) {
+ a = a1 + i * step;
r = el.b/sqrt(1 - (el.e * cos(a))^2);
- op = op..Rp * Rp.polar(r, a + da);
+ op = join(op, Rp*Rp.polar(r, da + a));
}
- return shift(el.C.x * Rp.i + el.C.y * Rp.j) * (direction ? op : reverse(op));
+
+ return shift(el.C.x*Rp.i + el.C.y*Rp.j) * (direction ? op : reverse(op));
}
-/*<asyxml><function type = "path" signature = "arcfromcenter(hyperbola, real, real, int, bool)"><code></asyxml>*/
+/*<asyxml><function type="path" signature="arcfromcenter(hyperbola,real,real,int,bool)"><code></asyxml>*/
path arcfromcenter(hyperbola h, real angle1, real angle2,
int n = hyperbolanodesnumber(h, angle1, angle2),
bool direction = CCW)
@@ -3605,7 +3615,7 @@ path arcfromcenter(hyperbola h, real angle1, real angle2,
(direction ? op : op == nullpath ? op : reverse(op));
}
-/*<asyxml><function type = "path" signature = "arcfromcenter(explicit conic, real, real, int, bool)"><code></asyxml>*/
+/*<asyxml><function type="path" signature="arcfromcenter(explicit conic,real,real,int,bool)"><code></asyxml>*/
path arcfromcenter(explicit conic co, real angle1, real angle2,
int n, bool direction = CCW)
{/*<asyxml></code><documentation>Use arcfromcenter(ellipse, ...) or arcfromcenter(hyperbola, ...) depending of
@@ -3621,12 +3631,12 @@ path arcfromcenter(explicit conic co, real angle1, real angle2,
return g;
}
-/*<asyxml><constant type = "polarconicroutine" signature = "fromCenter"><code></asyxml>*/
+/*<asyxml><constant type = "polarconicroutine" signature="fromCenter"><code></asyxml>*/
restricted polarconicroutine fromCenter = arcfromcenter;/*<asyxml></code><documentation></documentation></constant></asyxml>*/
-/*<asyxml><constant type = "polarconicroutine" signature = "fromFocus"><code></asyxml>*/
+/*<asyxml><constant type = "polarconicroutine" signature="fromFocus"><code></asyxml>*/
restricted polarconicroutine fromFocus = arcfromfocus;/*<asyxml></code><documentation></documentation></constant></asyxml>*/
-/*<asyxml><function type = "bqe" signature = "equation(ellipse)"><code></asyxml>*/
+/*<asyxml><function type="bqe" signature="equation(ellipse)"><code></asyxml>*/
bqe equation(ellipse el)
{/*<asyxml></code><documentation>Return the coefficients of the equation of the ellipse in its coordinate system:
bqe.a[0] * x^2 + bqe.a[1] * x * y + bqe.a[2] * y^2 + bqe.a[3] * x + bqe.a[4] * y + bqe.a[5] = 0.
@@ -3649,7 +3659,7 @@ bqe equation(ellipse el)
return bqe;
}
-/*<asyxml><function type = "bqe" signature = "equation(parabola)"><code></asyxml>*/
+/*<asyxml><function type="bqe" signature="equation(parabola)"><code></asyxml>*/
bqe equation(parabola p)
{/*<asyxml></code><documentation>Return the coefficients of the equation of the parabola in its coordinate system.
bqe.a[0] * x^2 + bqe.a[1] * x * y + bqe.a[2] * y^2 + bqe.a[3] * x + bqe.a[4] * y + bqe.a[5] = 0
@@ -3662,7 +3672,7 @@ bqe equation(parabola p)
bqe(R, 0, 0, 1, -4 * a, 0, 0));
}
-/*<asyxml><function type = "bqe" signature = "equation(hyperbola)"><code></asyxml>*/
+/*<asyxml><function type="bqe" signature="equation(hyperbola)"><code></asyxml>*/
bqe equation(hyperbola h)
{/*<asyxml></code><documentation>Return the coefficients of the equation of the hyperbola in its coordinate system.
bqe.a[0] * x^2 + bqe.a[1] * x * y + bqe.a[2] * y^2 + bqe.a[3] * x + bqe.a[4] * y + bqe.a[5] = 0
@@ -3672,7 +3682,7 @@ bqe equation(hyperbola h)
bqe(R, 1/h.a^2, 0, -1/h.b^2, 0, 0, -1));
}
-/*<asyxml><operator type = "path" signature = "cast(ellipse)"><code></asyxml>*/
+/*<asyxml><operator type = "path" signature="cast(ellipse)"><code></asyxml>*/
path operator cast(ellipse el)
{/*<asyxml></code><documentation>Cast ellipse to path.</documentation></operator></asyxml>*/
if(degenerate(el))
@@ -3681,13 +3691,13 @@ path operator cast(ellipse el)
return arcfromcenter(el, 0.0, 360, CCW, n)&cycle;
}
-/*<asyxml><operator type = "path" signature = "cast(circle)"><code></asyxml>*/
+/*<asyxml><operator type = "path" signature="cast(circle)"><code></asyxml>*/
path operator cast(circle c)
{/*<asyxml></code><documentation>Cast circle to path.</documentation></operator></asyxml>*/
return (path)((ellipse)c);
}
-/*<asyxml><function type = "real[]" signature = "bangles(picture, parabola)"><code></asyxml>*/
+/*<asyxml><function type="real[]" signature="bangles(picture,parabola)"><code></asyxml>*/
real[] bangles(picture pic = currentpicture, parabola p)
{/*<asyxml></code><documentation>Return the array {ma, Ma} where 'ma' and 'Ma' are respectively
the smaller and the larger angles for which the parabola 'p' is included
@@ -3724,7 +3734,7 @@ real[] bangles(picture pic = currentpicture, parabola p)
return new real[] {ma, Ma};
}
-/*<asyxml><function type = "real[][]" signature = "bangles(picture, hyperbola)"><code></asyxml>*/
+/*<asyxml><function type="real[][]" signature="bangles(picture,hyperbola)"><code></asyxml>*/
real[][] bangles(picture pic = currentpicture, hyperbola h)
{/*<asyxml></code><documentation>Return the array {{ma1, Ma1}, {ma2, Ma2}} where 'maX' and 'MaX' are respectively
the smaller and the bigger angles (from h.FX) for which the hyperbola 'h' is included
@@ -3764,12 +3774,12 @@ real[][] bangles(picture pic = currentpicture, hyperbola h)
return (360 - d + degrees(inter[i][n]-F1))%360;
}, inter[i].length);
ma[i] = a.length != 0 ? min(a) : 0;
- Ma[i] = a.length != 0 ? max(a) : 0;
+ Ma[i] = a.length != 0 ? max(a) : 0;
}
return new real[][] {{ma[0], Ma[0]}, {ma[1], Ma[1]}};
}
-/*<asyxml><operator type = "path" signature = "cast(parabola)"><code></asyxml>*/
+/*<asyxml><operator type = "path" signature="cast(parabola)"><code></asyxml>*/
path operator cast(parabola p)
{/*<asyxml></code><documentation>Cast parabola to path.
If possible, the returned path is restricted to the actual bounding box
@@ -3781,7 +3791,7 @@ path operator cast(parabola p)
}
-/*<asyxml><function type = "void" signature = "draw(picture, Label, circle, align, pen, arrowbar, arrowbar, margin, Label, marker)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="draw(picture,Label,circle,align,pen,arrowbar,arrowbar,margin,Label,marker)"><code></asyxml>*/
void draw(picture pic = currentpicture, Label L = "", circle c,
align align = NoAlign, pen p = currentpen,
arrowbar arrow = None, arrowbar bar = None,
@@ -3791,7 +3801,7 @@ void draw(picture pic = currentpicture, Label L = "", circle c,
else draw(pic, L, (path)c, align, p, arrow, bar, margin, legend, marker);
}
-/*<asyxml><function type = "void" signature = "draw(picture, Label, ellipse, align, pen, arrowbar, arrowbar, margin, Label, marker)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="draw(picture,Label,ellipse,align,pen,arrowbar,arrowbar,margin,Label,marker)"><code></asyxml>*/
void draw(picture pic = currentpicture, Label L = "", ellipse el,
align align = NoAlign, pen p = currentpen,
arrowbar arrow = None, arrowbar bar = None,
@@ -3801,7 +3811,7 @@ void draw(picture pic = currentpicture, Label L = "", ellipse el,
else draw(pic, L, (path)el, align, p, arrow, bar, margin, legend, marker);
}
-/*<asyxml><function type = "void" signature = "draw(picture, Label, parabola, align, pen, arrowbar, arrowbar, margin, Label, marker)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="draw(picture,Label,parabola,align,pen,arrowbar,arrowbar,margin,Label,marker)"><code></asyxml>*/
void draw(picture pic = currentpicture, Label L = "", parabola parabola,
align align = NoAlign, pen p = currentpen,
arrowbar arrow = None, arrowbar bar = None,
@@ -3814,8 +3824,12 @@ void draw(picture pic = currentpicture, Label L = "", parabola parabola,
parabola.bmin = inverse(t) * m;
parabola.bmax = inverse(t) * M;
picture tmp;
- draw(tmp, L, t * ((path) (T * parabola)), align, p, arrow, bar, NoMargin, legend, marker);
- add(f, tmp.fit());
+ path pp = t * ((path) (T * parabola));
+
+ if (pp != nullpath) {
+ draw(tmp, L, pp, align, p, arrow, bar, NoMargin, legend, marker);
+ add(f, tmp.fit());
+ }
}, true);
pair m = pic.userMin(), M = pic.userMax();
@@ -3824,7 +3838,7 @@ void draw(picture pic = currentpicture, Label L = "", parabola parabola,
}
}
-/*<asyxml><operator type = "path" signature = "cast(hyperbola)"><code></asyxml>*/
+/*<asyxml><operator type = "path" signature="cast(hyperbola)"><code></asyxml>*/
path operator cast(hyperbola h)
{/*<asyxml></code><documentation>Cast hyperbola to path.
If possible, the returned path is restricted to the actual bounding box
@@ -3836,7 +3850,7 @@ path operator cast(hyperbola h)
return arcfromfocus(h, bangles[0][0], bangles[0][1], n, CCW);
}
-/*<asyxml><function type = "void" signature = "draw(picture, Label, hyperbola, align, pen, arrowbar, arrowbar, margin, Label, marker)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="draw(picture,Label,hyperbola,align,pen,arrowbar,arrowbar,margin,Label,marker)"><code></asyxml>*/
void draw(picture pic = currentpicture, Label L = "", hyperbola h,
align align = NoAlign, pen p = currentpen,
arrowbar arrow = None, arrowbar bar = None,
@@ -3848,15 +3862,22 @@ void draw(picture pic = currentpicture, Label L = "", hyperbola h,
m -= min(p); M -= max(p);
h.bmin = inverse(t) * m;
h.bmax = inverse(t) * M;
+ path hp;
picture tmp;
- draw(tmp, L, t * ((path) (T * h)), align, p, arrow, bar, NoMargin, legend, marker);
+ hp = t * ((path) (T * h));
+ if (hp != nullpath) {
+ draw(tmp, L, hp, align, p, arrow, bar, NoMargin, legend, marker);
+ }
hyperbola ht = hyperbola(h.F2, h.F1, h.a);
ht.bmin = h.bmin;
ht.bmax = h.bmax;
- draw(tmp, "", t * ((path) (T * ht)), align, p, arrow, bar, NoMargin, marker);
+ hp = t * ((path) (T * ht));
+ if (hp != nullpath) {
+ draw(tmp, "", hp, align, p, arrow, bar, NoMargin, marker);
+ }
add(f, tmp.fit());
}, true);
@@ -3866,7 +3887,7 @@ void draw(picture pic = currentpicture, Label L = "", hyperbola h,
pic.addBox(truepoint(SW), truepoint(NE));
}
-/*<asyxml><function type = "void" signature = "draw(picture, Label, explicit conic, align, pen, arrowbar, arrowbar, margin, Label, marker)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="draw(picture,Label,explicit conic,align,pen,arrowbar,arrowbar,margin,Label,marker)"><code></asyxml>*/
void draw(picture pic = currentpicture, Label L = "", explicit conic co,
align align = NoAlign, pen p = currentpen,
arrowbar arrow = None, arrowbar bar = None,
@@ -3884,7 +3905,7 @@ void draw(picture pic = currentpicture, Label L = "", explicit conic co,
else abort("draw: unknown conic.");
}
-/*<asyxml><function type = "int" signature = "conicnodesnumber(conic, real, real)"><code></asyxml>*/
+/*<asyxml><function type="int" signature="conicnodesnumber(conic,real,real)"><code></asyxml>*/
int conicnodesnumber(conic co, real angle1, real angle2, bool dir = CCW)
{/*<asyxml></code><documentation>Return the number of node to draw a conic arc.</documentation></function></asyxml>*/
int oi;
@@ -3904,7 +3925,7 @@ int conicnodesnumber(conic co, real angle1, real angle2, bool dir = CCW)
return oi;
}
-/*<asyxml><operator type = "path" signature = "cast(conic)"><code></asyxml>*/
+/*<asyxml><operator type = "path" signature="cast(conic)"><code></asyxml>*/
path operator cast(conic co)
{/*<asyxml></code><documentation>Cast conic section to path.</documentation></operator></asyxml>*/
if(co.e < 1) return (path)((ellipse)co);
@@ -3912,7 +3933,7 @@ path operator cast(conic co)
return (path)((hyperbola)co);
}
-/*<asyxml><function type = "bqe" signature = "equation(explicit conic)"><code></asyxml>*/
+/*<asyxml><function type="bqe" signature="equation(explicit conic)"><code></asyxml>*/
bqe equation(explicit conic co)
{/*<asyxml></code><documentation>Return the coefficients of the equation of conic section in its coordinate system:
bqe.a[0] * x^2 + bqe.a[1] * x * y + bqe.a[2] * y^2 + bqe.a[3] * x + bqe.a[4] * y + bqe.a[5] = 0.
@@ -3930,7 +3951,7 @@ bqe equation(explicit conic co)
return obqe;
}
-/*<asyxml><function type = "string" signature = "conictype(bqe)"><code></asyxml>*/
+/*<asyxml><function type="string" signature="conictype(bqe)"><code></asyxml>*/
string conictype(bqe bqe)
{/*<asyxml></code><documentation>Returned values are "ellipse" or "parabola" or "hyperbola"
depending of the conic section represented by 'bqe'.</documentation></function></asyxml>*/
@@ -3950,7 +3971,7 @@ string conictype(bqe bqe)
return os;
}
-/*<asyxml><function type = "conic" signature = "conic(point, point, point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="conic" signature="conic(point,point,point,point,point)"><code></asyxml>*/
conic conic(point M1, point M2, point M3, point M4, point M5)
{/*<asyxml></code><documentation>Return the conic passing through 'M1', 'M2', 'M3', 'M4' and 'M5' if the conic is not degenerated.</documentation></function></asyxml>*/
bqe bqe = bqe(M1, M2, M3, M4, M5);
@@ -3961,7 +3982,7 @@ conic conic(point M1, point M2, point M3, point M4, point M5)
return hyperbola(bqe);
}
-/*<asyxml><function type = "coordsys" signature = "canonicalcartesiansystem(hyperbola)"><code></asyxml>*/
+/*<asyxml><function type="coordsys" signature="canonicalcartesiansystem(hyperbola)"><code></asyxml>*/
coordsys canonicalcartesiansystem(explicit conic co)
{/*<asyxml></code><documentation>Return the canonical cartesian system of the conic 'co'.</documentation></function></asyxml>*/
if(co.e < 1) return canonicalcartesiansystem((ellipse)co);
@@ -3969,7 +3990,7 @@ coordsys canonicalcartesiansystem(explicit conic co)
return canonicalcartesiansystem((hyperbola)co);
}
-/*<asyxml><function type = "bqe" signature = "canonical(bqe)"><code></asyxml>*/
+/*<asyxml><function type="bqe" signature="canonical(bqe)"><code></asyxml>*/
bqe canonical(bqe bqe)
{/*<asyxml></code><documentation>Return the bivariate quadratic equation relative to the
canonical coordinate system of the conic section represented by 'bqe'.</documentation></function></asyxml>*/
@@ -3991,7 +4012,7 @@ bqe canonical(bqe bqe)
return obqe;
}
-/*<asyxml><function type = "conic" signature = "conic(bqe)"><code></asyxml>*/
+/*<asyxml><function type="conic" signature="conic(bqe)"><code></asyxml>*/
conic conic(bqe bqe)
{/*<asyxml></code><documentation>Return the conic section represented by the bivariate quartic equation 'bqe'.</documentation></function></asyxml>*/
string type = conictype(bqe);
@@ -4005,13 +4026,13 @@ conic conic(bqe bqe)
return oc;
}
-/*<asyxml><function type = "real" signature = "arclength(circle)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="arclength(circle)"><code></asyxml>*/
real arclength(circle c)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
return c.r * 2 * pi;
}
-/*<asyxml><function type = "real" signature = "focusToCenter(ellipse, real)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="focusToCenter(ellipse,real)"><code></asyxml>*/
real focusToCenter(ellipse el, real a)
{/*<asyxml></code><documentation>Return the angle relatively to the center of 'el' for the angle 'a'
given relatively to the focus of 'el'.</documentation></function></asyxml>*/
@@ -4022,7 +4043,7 @@ real focusToCenter(ellipse el, real a)
return d%(sgnd(a) * 360);
}
-/*<asyxml><function type = "real" signature = "centerToFocus(ellipse, real)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="centerToFocus(ellipse,real)"><code></asyxml>*/
real centerToFocus(ellipse el, real a)
{/*<asyxml></code><documentation>Return the angle relatively to the focus of 'el' for the angle 'a'
given relatively to the center of 'el'.</documentation></function></asyxml>*/
@@ -4034,13 +4055,13 @@ real centerToFocus(ellipse el, real a)
return d%(sgnd(a) * 360);
}
-/*<asyxml><function type = "real" signature = "arclength(ellipse)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="arclength(ellipse)"><code></asyxml>*/
real arclength(ellipse el)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
return degenerate(el) ? infinity : 4 * el.a * elle(pi/2, el.e);
}
-/*<asyxml><function type = "real" signature = "arclength(ellipse, real, real, bool, polarconicroutine)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="arclength(ellipse,real,real,bool,polarconicroutine)"><code></asyxml>*/
real arclength(ellipse el, real angle1, real angle2,
bool direction = CCW,
polarconicroutine polarconicroutine = currentpolarconicroutine)
@@ -4113,7 +4134,7 @@ real arclength(ellipse el, real angle1, real angle2,
return S(a2) - S(a1);
}
-/*<asyxml><function type = "real" signature = "arclength(parabola, real)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="arclength(parabola,real)"><code></asyxml>*/
real arclength(parabola p, real angle)
{/*<asyxml></code><documentation>Return the arclength from 180 to 'angle' given from focus in the
canonical coordinate system of 'p'.</documentation></function></asyxml>*/
@@ -4126,14 +4147,14 @@ real arclength(parabola p, real angle)
return S(t);
}
-/*<asyxml><function type = "real" signature = "arclength(parabola, real, real)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="arclength(parabola,real,real)"><code></asyxml>*/
real arclength(parabola p, real angle1, real angle2)
{/*<asyxml></code><documentation>Return the arclength from 'angle1' to 'angle2' given from
focus in the canonical coordinate system of 'p'</documentation></function></asyxml>*/
return arclength(p, angle1) - arclength(p, angle2);
}
-/*<asyxml><function type = "real" signature = "arclength(parabola p)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="arclength(parabola p)"><code></asyxml>*/
real arclength(parabola p)
{/*<asyxml></code><documentation>Return the length of the arc of the parabola bounded to the bounding
box of the current picture.</documentation></function></asyxml>*/
@@ -4145,15 +4166,15 @@ real arclength(parabola p)
// *=======================================================*
// *.......................ABSCISSA........................*
-/*<asyxml><struct signature = "abscissa"><code></asyxml>*/
+/*<asyxml><struct signature="abscissa"><code></asyxml>*/
struct abscissa
{/*<asyxml></code><documentation>Provide abscissa structure on a curve used in the routine-like 'point(object, abscissa)'
- where object can be 'line', 'segment', 'ellipse', 'circle', 'conic'...</documentation><property type = "real" signature = "x"><code></asyxml>*/
- real x;/*<asyxml></code><documentation>The abscissa value.</documentation></property><property type = "int" signature = "system"><code></asyxml>*/
- int system;/*<asyxml></code><documentation>0 = relativesystem; 1 = curvilinearsystem; 2 = angularsystem; 3 = nodesystem</documentation></property><property type = "polarconicroutine" signature = "polarconicroutine"><code></asyxml>*/
+ where object can be 'line','segment','ellipse','circle','conic'...</documentation><property type = "real" signature="x"><code></asyxml>*/
+ real x;/*<asyxml></code><documentation>The abscissa value.</documentation></property><property type = "int" signature="system"><code></asyxml>*/
+ int system;/*<asyxml></code><documentation>0 = relativesystem; 1 = curvilinearsystem; 2 = angularsystem; 3 = nodesystem</documentation></property><property type = "polarconicroutine" signature="polarconicroutine"><code></asyxml>*/
polarconicroutine polarconicroutine = fromCenter;/*<asyxml></code><documentation>The routine used with angular system and two foci conic section.
Possible values are 'formCenter' and 'formFocus'.</documentation></property></asyxml>*/
- /*<asyxml><method type = "abscissa" signature = "copy()"><code></asyxml>*/
+ /*<asyxml><method type = "abscissa" signature="copy()"><code></asyxml>*/
abscissa copy()
{/*<asyxml></code><documentation>Return a copy of this abscissa.</documentation></method></asyxml>*/
abscissa oa = new abscissa;
@@ -4164,10 +4185,10 @@ struct abscissa
}
}/*<asyxml></struct></asyxml>*/
-/*<asyxml><constant type = "int" signature = "relativesystem, curvilinearsystem, angularsystem, nodesystem"><code></asyxml>*/
+/*<asyxml><constant type = "int" signature="relativesystem,curvilinearsystem,angularsystem,nodesystem"><code></asyxml>*/
restricted int relativesystem = 0, curvilinearsystem = 1, angularsystem = 2, nodesystem = 3;/*<asyxml></code><documentation>Constant used to set the abscissa system.</documentation></constant></asyxml>*/
-/*<asyxml><operator type = "abscissa" signature = "cast(explicit position)"><code></asyxml>*/
+/*<asyxml><operator type = "abscissa" signature="cast(explicit position)"><code></asyxml>*/
abscissa operator cast(explicit position position)
{/*<asyxml></code><documentation>Cast position to abscissa.
If 'position' is relative, the abscissa is relative else it's a curvilinear abscissa.</documentation></operator></asyxml>*/
@@ -4177,7 +4198,7 @@ abscissa operator cast(explicit position position)
return oarcc;
}
-/*<asyxml><operator type = "abscissa" signature = "+(real, explicit abscissa)"><code></asyxml>*/
+/*<asyxml><operator type = "abscissa" signature="+(real,explicit abscissa)"><code></asyxml>*/
abscissa operator +(real x, explicit abscissa a)
{/*<asyxml></code><documentation>Provide 'real + abscissa'.
Return abscissa b so that b.x = a.x + x.
@@ -4186,6 +4207,7 @@ abscissa operator +(real x, explicit abscissa a)
oa.x = a.x + x;
return oa;
}
+
abscissa operator +(explicit abscissa a, real x)
{
return x + a;
@@ -4195,7 +4217,7 @@ abscissa operator +(int x, explicit abscissa a)
return ((real)x) + a;
}
-/*<asyxml><operator type = "abscissa" signature = "-(explicit abscissa a)"><code></asyxml>*/
+/*<asyxml><operator type = "abscissa" signature="-(explicit abscissa a)"><code></asyxml>*/
abscissa operator -(explicit abscissa a)
{/*<asyxml></code><documentation>Return the abscissa b so that b.x = -a.x.</documentation></operator></asyxml>*/
abscissa oa;
@@ -4223,7 +4245,7 @@ abscissa operator -(int x, explicit abscissa a)
return ((real)x) - a;
}
-/*<asyxml><operator type = "abscissa" signature = "*(real, abscissa)"><code></asyxml>*/
+/*<asyxml><operator type = "abscissa" signature="*(real,abscissa)"><code></asyxml>*/
abscissa operator *(real x, explicit abscissa a)
{/*<asyxml></code><documentation>Provide 'real * abscissa'.
Return abscissa b so that b.x = x * a.x.
@@ -4258,7 +4280,7 @@ abscissa operator /(int x, explicit abscissa a)
return ((real)x)/a;
}
-/*<asyxml><function type = "abscissa" signature = "relabscissa(real)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="relabscissa(real)"><code></asyxml>*/
abscissa relabscissa(real x)
{/*<asyxml></code><documentation>Return a relative abscissa.</documentation></function></asyxml>*/
return (abscissa)(Relative(x));
@@ -4268,7 +4290,7 @@ abscissa relabscissa(int x)
return (abscissa)(Relative(x));
}
-/*<asyxml><function type = "abscissa" signature = "curabscissa(real)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="curabscissa(real)"><code></asyxml>*/
abscissa curabscissa(real x)
{/*<asyxml></code><documentation>Return a curvilinear abscissa.</documentation></function></asyxml>*/
return (abscissa)((position)x);
@@ -4278,7 +4300,7 @@ abscissa curabscissa(int x)
return (abscissa)((position)x);
}
-/*<asyxml><function type = "abscissa" signature = "angabscissa(real, polarconicroutine)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="angabscissa(real,polarconicroutine)"><code></asyxml>*/
abscissa angabscissa(real x, polarconicroutine polarconicroutine = currentpolarconicroutine)
{/*<asyxml></code><documentation>Return a angular abscissa.</documentation></function></asyxml>*/
abscissa oarcc;
@@ -4292,7 +4314,7 @@ abscissa angabscissa(int x, polarconicroutine polarconicroutine = currentpolarco
return angabscissa((real)x, polarconicroutine);
}
-/*<asyxml><function type = "abscissa" signature = "nodabscissa(real)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="nodabscissa(real)"><code></asyxml>*/
abscissa nodabscissa(real x)
{/*<asyxml></code><documentation>Return an abscissa as time on the path.</documentation></function></asyxml>*/
abscissa oarcc;
@@ -4305,7 +4327,7 @@ abscissa nodabscissa(int x)
return nodabscissa((real)x);
}
-/*<asyxml><operator type = "abscissa" signature = "cast(real)"><code></asyxml>*/
+/*<asyxml><operator type = "abscissa" signature="cast(real)"><code></asyxml>*/
abscissa operator cast(real x)
{/*<asyxml></code><documentation>Cast real to abscissa, precisely 'nodabscissa'.</documentation></operator></asyxml>*/
return nodabscissa(x);
@@ -4315,7 +4337,7 @@ abscissa operator cast(int x)
return nodabscissa((real)x);
}
-/*<asyxml><function type = "point" signature = "point(circle, abscissa)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(circle,abscissa)"><code></asyxml>*/
point point(circle c, abscissa l)
{/*<asyxml></code><documentation>Return the point of 'c' which has the abscissa 'l.x'
according to the abscissa system 'l.system'.</documentation></function></asyxml>*/
@@ -4332,7 +4354,7 @@ point point(circle c, abscissa l)
return (0, 0);
}
-/*<asyxml><function type = "point" signature = "point(ellipse, abscissa)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(ellipse,abscissa)"><code></asyxml>*/
point point(ellipse el, abscissa l)
{/*<asyxml></code><documentation>Return the point of 'el' which has the abscissa 'l.x'
according to the abscissa system 'l.system'.</documentation></function></asyxml>*/
@@ -4362,7 +4384,7 @@ point point(ellipse el, abscissa l)
return (0, 0);
}
-/*<asyxml><function type = "point" signature = "point(parabola, abscissa)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(parabola,abscissa)"><code></asyxml>*/
point point(parabola p, abscissa l)
{/*<asyxml></code><documentation>Return the point of 'p' which has the abscissa 'l.x'
according to the abscissa system 'l.system'.</documentation></function></asyxml>*/
@@ -4390,7 +4412,7 @@ point point(parabola p, abscissa l)
return (0, 0);
}
-/*<asyxml><function type = "point" signature = "point(hyperbola, abscissa)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(hyperbola,abscissa)"><code></asyxml>*/
point point(hyperbola h, abscissa l)
{/*<asyxml></code><documentation>Return the point of 'h' which has the abscissa 'l.x'
according to the abscissa system 'l.system'.</documentation></function></asyxml>*/
@@ -4411,7 +4433,7 @@ Try relpoint((path)your_hyperbola, x);");
return (0, 0);
}
-/*<asyxml><function type = "abscissa" signature = "point(conic, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="point(conic,point)"><code></asyxml>*/
point point(explicit conic co, abscissa l)
{/*<asyxml></code><documentation>Return the curvilinear abscissa of 'M' on the conic 'co'.</documentation></function></asyxml>*/
if(co.e == 0) return point((circle)co, l);
@@ -4421,7 +4443,7 @@ point point(explicit conic co, abscissa l)
}
-/*<asyxml><function type = "point" signature = "point(line, abscissa)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(line,abscissa)"><code></asyxml>*/
point point(line l, abscissa x)
{/*<asyxml></code><documentation>Return the point of 'l' which has the abscissa 'l.x' according to the abscissa system 'l.system'.
Note that the origin is l.A, and point(l, relabscissa(x)) returns l.A + x.x * vector(l.B - l.A).</documentation></function></asyxml>*/
@@ -4438,7 +4460,7 @@ point point(line l, abscissa x)
return (0, 0);
}
-/*<asyxml><function type = "point" signature = "point(line, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(line,real)"><code></asyxml>*/
point point(line l, explicit real x)
{/*<asyxml></code><documentation>Return the point between node l.A and l.B (x <= 0 means l.A, x >=1 means l.B).</documentation></function></asyxml>*/
return point(l, nodabscissa(x));
@@ -4448,7 +4470,7 @@ point point(line l, explicit int x)
return point(l, nodabscissa(x));
}
-/*<asyxml><function type = "circle" signature = "point(explicit circle, explicit real)"><code></asyxml>*/
+/*<asyxml><function type="circle" signature="point(explicit circle,explicit real)"><code></asyxml>*/
point point(explicit circle c, explicit real x)
{/*<asyxml></code><documentation>Return the point between node floor(x) and floor(x) + 1.</documentation></function></asyxml>*/
return point(c, nodabscissa(x));
@@ -4458,7 +4480,7 @@ point point(explicit circle c, explicit int x)
return point(c, nodabscissa(x));
}
-/*<asyxml><function type = "point" signature = "point(explicit ellipse, explicit real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(explicit ellipse,explicit real)"><code></asyxml>*/
point point(explicit ellipse el, explicit real x)
{/*<asyxml></code><documentation>Return the point between node floor(x) and floor(x) + 1.</documentation></function></asyxml>*/
return point(el, nodabscissa(x));
@@ -4468,7 +4490,7 @@ point point(explicit ellipse el, explicit int x)
return point(el, nodabscissa(x));
}
-/*<asyxml><function type = "point" signature = "point(explicit parabola, explicit real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(explicit parabola,explicit real)"><code></asyxml>*/
point point(explicit parabola p, explicit real x)
{/*<asyxml></code><documentation>Return the point between node floor(x) and floor(x) + 1.</documentation></function></asyxml>*/
return point(p, nodabscissa(x));
@@ -4478,7 +4500,7 @@ point point(explicit parabola p, explicit int x)
return point(p, nodabscissa(x));
}
-/*<asyxml><function type = "point" signature = "point(explicit hyperbola, explicit real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(explicit hyperbola,explicit real)"><code></asyxml>*/
point point(explicit hyperbola h, explicit real x)
{/*<asyxml></code><documentation>Return the point between node floor(x) and floor(x) + 1.</documentation></function></asyxml>*/
return point(h, nodabscissa(x));
@@ -4488,7 +4510,7 @@ point point(explicit hyperbola h, explicit int x)
return point(h, nodabscissa(x));
}
-/*<asyxml><function type = "point" signature = "point(explicit conic, explicit real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(explicit conic,explicit real)"><code></asyxml>*/
point point(explicit conic co, explicit real x)
{/*<asyxml></code><documentation>Return the point between node floor(x) and floor(x) + 1.</documentation></function></asyxml>*/
point op;
@@ -4503,27 +4525,27 @@ point point(explicit conic co, explicit int x)
return point(co, (real)x);
}
-/*<asyxml><function type = "point" signature = "relpoint(line, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="relpoint(line,real)"><code></asyxml>*/
point relpoint(line l, real x)
{/*<asyxml></code><documentation>Return the relative point of 'l' (0 means l.A,
1 means l.B, x means l.A + x * vector(l.B - l.A) ).</documentation></function></asyxml>*/
return point(l, Relative(x));
}
-/*<asyxml><function type = "point" signature = "relpoint(explicit circle, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="relpoint(explicit circle,real)"><code></asyxml>*/
point relpoint(explicit circle c, real x)
{/*<asyxml></code><documentation>Return the relative point of 'c' (0 means origin, 1 means end).
Origin is c.center + c.r * (1, 0).</documentation></function></asyxml>*/
return point(c, Relative(x));
}
-/*<asyxml><function type = "point" signature = "relpoint(explicit ellipse, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="relpoint(explicit ellipse,real)"><code></asyxml>*/
point relpoint(explicit ellipse el, real x)
{/*<asyxml></code><documentation>Return the relative point of 'el' (0 means origin, 1 means end).</documentation></function></asyxml>*/
return point(el, Relative(x));
}
-/*<asyxml><function type = "point" signature = "relpoint(explicit parabola, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="relpoint(explicit parabola,real)"><code></asyxml>*/
point relpoint(explicit parabola p, real x)
{/*<asyxml></code><documentation>Return the relative point of the path of the parabola
bounded by the bounding box of the current picture.
@@ -4531,13 +4553,13 @@ point relpoint(explicit parabola p, real x)
return point(p, Relative(x));
}
-/*<asyxml><function type = "point" signature = "relpoint(explicit hyperbola, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="relpoint(explicit hyperbola,real)"><code></asyxml>*/
point relpoint(explicit hyperbola h, real x)
{/*<asyxml></code><documentation>Not yet implemented... <look href = "point(hyperbola, abscissa)"/></documentation></function></asyxml>*/
return point(h, Relative(x));
}
-/*<asyxml><function type = "point" signature = "relpoint(explicit conic, explicit real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="relpoint(explicit conic,explicit real)"><code></asyxml>*/
point relpoint(explicit conic co, explicit real x)
{/*<asyxml></code><documentation>Return the relative point of 'co' (0 means origin, 1 means end).</documentation></function></asyxml>*/
point op;
@@ -4552,13 +4574,13 @@ point relpoint(explicit conic co, explicit int x)
return relpoint(co, (real)x);
}
-/*<asyxml><function type = "point" signature = "angpoint(explicit circle, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="angpoint(explicit circle,real)"><code></asyxml>*/
point angpoint(explicit circle c, real x)
{/*<asyxml></code><documentation>Return the point of 'c' in the direction 'x' measured in degrees.</documentation></function></asyxml>*/
return point(c, angabscissa(x));
}
-/*<asyxml><function type = "point" signature = "angpoint(explicit ellipse, real, polarconicroutine)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="angpoint(explicit ellipse,real,polarconicroutine)"><code></asyxml>*/
point angpoint(explicit ellipse el, real x,
polarconicroutine polarconicroutine = currentpolarconicroutine)
{/*<asyxml></code><documentation>Return the point of 'el' in the direction 'x'
@@ -4566,13 +4588,13 @@ point angpoint(explicit ellipse el, real x,
return el.e == 0 ? angpoint((circle) el, x) : point(el, angabscissa(x, polarconicroutine));
}
-/*<asyxml><function type = "point" signature = "angpoint(explicit parabola, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="angpoint(explicit parabola,real)"><code></asyxml>*/
point angpoint(explicit parabola p, real x)
{/*<asyxml></code><documentation>Return the point of 'p' in the direction 'x' measured in degrees.</documentation></function></asyxml>*/
return point(p, angabscissa(x));
}
-/*<asyxml><function type = "point" signature = "angpoint(explicit hyperbola, real, polarconicroutine)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="angpoint(explicit hyperbola,real,polarconicroutine)"><code></asyxml>*/
point angpoint(explicit hyperbola h, real x,
polarconicroutine polarconicroutine = currentpolarconicroutine)
{/*<asyxml></code><documentation>Return the point of 'h' in the direction 'x'
@@ -4580,34 +4602,34 @@ point angpoint(explicit hyperbola h, real x,
return point(h, angabscissa(x, polarconicroutine));
}
-/*<asyxml><function type = "point" signature = "curpoint(line, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="curpoint(line,real)"><code></asyxml>*/
point curpoint(line l, real x)
{/*<asyxml></code><documentation>Return the point of 'l' which has the curvilinear abscissa 'x'.
Origin is l.A.</documentation></function></asyxml>*/
return point(l, curabscissa(x));
}
-/*<asyxml><function type = "point" signature = "curpoint(explicit circle, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="curpoint(explicit circle,real)"><code></asyxml>*/
point curpoint(explicit circle c, real x)
{/*<asyxml></code><documentation>Return the point of 'c' which has the curvilinear abscissa 'x'.
Origin is c.center + c.r * (1, 0).</documentation></function></asyxml>*/
return point(c, curabscissa(x));
}
-/*<asyxml><function type = "point" signature = "curpoint(explicit ellipse, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="curpoint(explicit ellipse,real)"><code></asyxml>*/
point curpoint(explicit ellipse el, real x)
{/*<asyxml></code><documentation>Return the point of 'el' which has the curvilinear abscissa 'el'.</documentation></function></asyxml>*/
return point(el, curabscissa(x));
}
-/*<asyxml><function type = "point" signature = "curpoint(explicit parabola, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="curpoint(explicit parabola,real)"><code></asyxml>*/
point curpoint(explicit parabola p, real x)
{/*<asyxml></code><documentation>Return the point of 'p' which has the curvilinear abscissa 'x'.
Origin is the vertex of 'p'.</documentation></function></asyxml>*/
return point(p, curabscissa(x));
}
-/*<asyxml><function type = "point" signature = "curpoint(conic, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="curpoint(conic,real)"><code></asyxml>*/
point curpoint(conic co, real x)
{/*<asyxml></code><documentation>Return the point of 'co' which has the curvilinear abscissa 'x'.</documentation></function></asyxml>*/
point op;
@@ -4618,7 +4640,7 @@ point curpoint(conic co, real x)
return op;
}
-/*<asyxml><function type = "abscissa" signature = "angabscissa(circle, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="angabscissa(circle,point)"><code></asyxml>*/
abscissa angabscissa(circle c, point M)
{/*<asyxml></code><documentation>Return the angular abscissa of 'M' on the circle 'c'.</documentation></function></asyxml>*/
if(!(M @ c)) abort("angabscissa: the point is not on the circle.");
@@ -4629,7 +4651,7 @@ abscissa angabscissa(circle c, point M)
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "angabscissa(ellipse, point, polarconicroutine)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="angabscissa(ellipse,point,polarconicroutine)"><code></asyxml>*/
abscissa angabscissa(ellipse el, point M,
polarconicroutine polarconicroutine = currentpolarconicroutine)
{/*<asyxml></code><documentation>Return the angular abscissa of 'M' on the ellipse 'el' according to 'polarconicroutine'.</documentation></function></asyxml>*/
@@ -4643,7 +4665,7 @@ abscissa angabscissa(ellipse el, point M,
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "angabscissa(hyperbola, point, polarconicroutine)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="angabscissa(hyperbola,point,polarconicroutine)"><code></asyxml>*/
abscissa angabscissa(hyperbola h, point M,
polarconicroutine polarconicroutine = currentpolarconicroutine)
{/*<asyxml></code><documentation>Return the angular abscissa of 'M' on the hyperbola 'h' according to 'polarconicroutine'.</documentation></function></asyxml>*/
@@ -4657,7 +4679,7 @@ abscissa angabscissa(hyperbola h, point M,
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "angabscissa(parabola, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="angabscissa(parabola,point)"><code></asyxml>*/
abscissa angabscissa(parabola p, point M)
{/*<asyxml></code><documentation>Return the angular abscissa of 'M' on the parabola 'p'.</documentation></function></asyxml>*/
if(!(M @ p)) abort("angabscissa: the point is not on the parabola.");
@@ -4670,7 +4692,7 @@ abscissa angabscissa(parabola p, point M)
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "angabscissa(conic, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="angabscissa(conic,point)"><code></asyxml>*/
abscissa angabscissa(explicit conic co, point M)
{/*<asyxml></code><documentation>Return the angular abscissa of 'M' on the conic 'co'.</documentation></function></asyxml>*/
if(co.e == 0) return angabscissa((circle)co, M);
@@ -4679,7 +4701,7 @@ abscissa angabscissa(explicit conic co, point M)
return angabscissa((hyperbola)co, M);
}
-/*<asyxml><function type = "abscissa" signature = "curabscissa(line, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="curabscissa(line,point)"><code></asyxml>*/
abscissa curabscissa(line l, point M)
{/*<asyxml></code><documentation>Return the curvilinear abscissa of 'M' on the line 'l'.</documentation></function></asyxml>*/
if(!(M @ extend(l))) abort("curabscissa: the point is not on the line.");
@@ -4689,7 +4711,7 @@ abscissa curabscissa(line l, point M)
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "curabscissa(circle, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="curabscissa(circle,point)"><code></asyxml>*/
abscissa curabscissa(circle c, point M)
{/*<asyxml></code><documentation>Return the curvilinear abscissa of 'M' on the circle 'c'.</documentation></function></asyxml>*/
if(!(M @ c)) abort("curabscissa: the point is not on the circle.");
@@ -4699,7 +4721,7 @@ abscissa curabscissa(circle c, point M)
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "curabscissa(ellipse, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="curabscissa(ellipse,point)"><code></asyxml>*/
abscissa curabscissa(ellipse el, point M)
{/*<asyxml></code><documentation>Return the curvilinear abscissa of 'M' on the ellipse 'el'.</documentation></function></asyxml>*/
if(!(M @ el)) abort("curabscissa: the point is not on the ellipse.");
@@ -4711,7 +4733,7 @@ abscissa curabscissa(ellipse el, point M)
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "curabscissa(parabola, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="curabscissa(parabola,point)"><code></asyxml>*/
abscissa curabscissa(parabola p, point M)
{/*<asyxml></code><documentation>Return the curvilinear abscissa of 'M' on the parabola 'p'.</documentation></function></asyxml>*/
if(!(M @ p)) abort("curabscissa: the point is not on the parabola.");
@@ -4723,7 +4745,7 @@ abscissa curabscissa(parabola p, point M)
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "curabscissa(conic, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="curabscissa(conic,point)"><code></asyxml>*/
abscissa curabscissa(conic co, point M)
{/*<asyxml></code><documentation>Return the curvilinear abscissa of 'M' on the conic 'co'.</documentation></function></asyxml>*/
if(co.e > 1) abort("curabscissa: not implemented for this hyperbola.");
@@ -4732,7 +4754,7 @@ abscissa curabscissa(conic co, point M)
return curabscissa((parabola)co, M);
}
-/*<asyxml><function type = "abscissa" signature = "nodabscissa(line, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="nodabscissa(line,point)"><code></asyxml>*/
abscissa nodabscissa(line l, point M)
{/*<asyxml></code><documentation>Return the node abscissa of 'M' on the line 'l'.</documentation></function></asyxml>*/
if(!(M @ (segment)l)) abort("nodabscissa: the point is not on the segment.");
@@ -4742,7 +4764,7 @@ abscissa nodabscissa(line l, point M)
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "nodabscissa(circle, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="nodabscissa(circle,point)"><code></asyxml>*/
abscissa nodabscissa(circle c, point M)
{/*<asyxml></code><documentation>Return the node abscissa of 'M' on the circle 'c'.</documentation></function></asyxml>*/
if(!(M @ c)) abort("nodabscissa: the point is not on the circle.");
@@ -4752,7 +4774,7 @@ abscissa nodabscissa(circle c, point M)
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "nodabscissa(ellipse, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="nodabscissa(ellipse,point)"><code></asyxml>*/
abscissa nodabscissa(ellipse el, point M)
{/*<asyxml></code><documentation>Return the node abscissa of 'M' on the ellipse 'el'.</documentation></function></asyxml>*/
if(!(M @ el)) abort("nodabscissa: the point is not on the ellipse.");
@@ -4762,7 +4784,7 @@ abscissa nodabscissa(ellipse el, point M)
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "nodabscissa(parabola, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="nodabscissa(parabola,point)"><code></asyxml>*/
abscissa nodabscissa(parabola p, point M)
{/*<asyxml></code><documentation>Return the node abscissa OF 'M' on the parabola 'p'.</documentation></function></asyxml>*/
if(!(M @ p)) abort("nodabscissa: the point is not on the parabola.");
@@ -4775,7 +4797,7 @@ abscissa nodabscissa(parabola p, point M)
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "nodabscissa(conic, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="nodabscissa(conic,point)"><code></asyxml>*/
abscissa nodabscissa(conic co, point M)
{/*<asyxml></code><documentation>Return the node abscissa of 'M' on the conic 'co'.</documentation></function></asyxml>*/
if(co.e > 1) abort("nodabscissa: not implemented for hyperbola.");
@@ -4785,7 +4807,7 @@ abscissa nodabscissa(conic co, point M)
}
-/*<asyxml><function type = "abscissa" signature = "relabscissa(line, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="relabscissa(line,point)"><code></asyxml>*/
abscissa relabscissa(line l, point M)
{/*<asyxml></code><documentation>Return the relative abscissa of 'M' on the line 'l'.</documentation></function></asyxml>*/
if(!(M @ extend(l))) abort("relabscissa: the point is not on the line.");
@@ -4795,7 +4817,7 @@ abscissa relabscissa(line l, point M)
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "relabscissa(circle, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="relabscissa(circle,point)"><code></asyxml>*/
abscissa relabscissa(circle c, point M)
{/*<asyxml></code><documentation>Return the relative abscissa of 'M' on the circle 'c'.</documentation></function></asyxml>*/
if(!(M @ c)) abort("relabscissa: the point is not on the circle.");
@@ -4805,7 +4827,7 @@ abscissa relabscissa(circle c, point M)
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "relabscissa(ellipse, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="relabscissa(ellipse,point)"><code></asyxml>*/
abscissa relabscissa(ellipse el, point M)
{/*<asyxml></code><documentation>Return the relative abscissa of 'M' on the ellipse 'el'.</documentation></function></asyxml>*/
if(!(M @ el)) abort("relabscissa: the point is not on the ellipse.");
@@ -4816,11 +4838,10 @@ abscissa relabscissa(ellipse el, point M)
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "relabscissa(conic, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="relabscissa(conic,point)"><code></asyxml>*/
abscissa relabscissa(conic co, point M)
{/*<asyxml></code><documentation>Return the relative abscissa of 'M'
on the conic 'co'.</documentation></function></asyxml>*/
- write("PASS");
if(co.e > 1) abort("relabscissa: not implemented for hyperbola and parabola.");
if(co.e == 1) return relabscissa((parabola)co, M);
if(co.e == 0) return relabscissa((circle)co, M);
@@ -4831,20 +4852,20 @@ abscissa relabscissa(conic co, point M)
// *=======================================================*
// *.........................ARCS..........................*
-/*<asyxml><struct signature = "arc"><code></asyxml>*/
+/*<asyxml><struct signature="arc"><code></asyxml>*/
struct arc {
/*<asyxml></code><documentation>Implement oriented ellipse (included circle) arcs.
All the calculus with this structure will be as exact as Asymptote can do.
For a full precision, you must not cast 'arc' to 'path' excepted for drawing routines.
- </documentation><property type = "ellipse" signature = "el"><code></asyxml>*/
- ellipse el;/*<asyxml></code><documentation>The support of the arc.</documentation></property><property type = "real" signature = "angle0"><code></asyxml>*/
- restricted real angle0 = 0;/*<asyxml></code><documentation>Internal use: rotating a circle does not modify the origin point, this variable stocks the eventual angle rotation. This value is not used for ellipses which are not circles.</documentation></property><property type = "real" signature = "angle1, angle2"><code></asyxml>*/
- restricted real angle1, angle2;/*<asyxml></code><documentation>Values (in degrees) in ]-360, 360[.</documentation></property><property type = "bool" signature = "direction"><code></asyxml>*/
- bool direction = CCW;/*<asyxml></code><documentation>The arc will be drawn from 'angle1' to 'angle2' rotating in the direction 'direction'.</documentation></property><property type = "polarconicroutine" signature = "polarconicroutine"><code></asyxml>*/
+ </documentation><property type = "ellipse" signature="el"><code></asyxml>*/
+ ellipse el;/*<asyxml></code><documentation>The support of the arc.</documentation></property><property type = "real" signature="angle0"><code></asyxml>*/
+ restricted real angle0 = 0;/*<asyxml></code><documentation>Internal use: rotating a circle does not modify the origin point,this variable stocks the eventual angle rotation. This value is not used for ellipses which are not circles.</documentation></property><property type = "real" signature="angle1,angle2"><code></asyxml>*/
+ restricted real angle1, angle2;/*<asyxml></code><documentation>Values (in degrees) in ]-360, 360[.</documentation></property><property type = "bool" signature="direction"><code></asyxml>*/
+ bool direction = CCW;/*<asyxml></code><documentation>The arc will be drawn from 'angle1' to 'angle2' rotating in the direction 'direction'.</documentation></property><property type = "polarconicroutine" signature="polarconicroutine"><code></asyxml>*/
polarconicroutine polarconicroutine = currentpolarconicroutine;/*<asyxml></code><documentation>The routine to which the angles refer.
If 'el' is a circle 'fromCenter' is always used.</documentation></property></asyxml>*/
- /*<asyxml><method type = "void" signature = "setangles(real, real, real)"><code></asyxml>*/
+ /*<asyxml><method type = "void" signature="setangles(real,real,real)"><code></asyxml>*/
void setangles(real a0, real a1, real a2)
{/*<asyxml></code><documentation>Set the angles.</documentation></method></asyxml>*/
if (a1 < 0 && a2 < 0) {
@@ -4856,7 +4877,7 @@ struct arc {
this.angle2 = a2%(sgnd(2) * 360);
}
- /*<asyxml><method type = "void" signature = "init(ellipse, real, real, real, polarconicroutine, bool)"><code></asyxml>*/
+ /*<asyxml><method type = "void" signature="init(ellipse,real,real,real,polarconicroutine,bool)"><code></asyxml>*/
void init(ellipse el, real angle0 = 0, real angle1, real angle2,
polarconicroutine polarconicroutine,
bool direction = CCW)
@@ -4868,7 +4889,7 @@ struct arc {
this.direction = direction;
}
- /*<asyxml><method type = "arc" signature = "copy()"><code></asyxml>*/
+ /*<asyxml><method type = "arc" signature="copy()"><code></asyxml>*/
arc copy()
{/*<asyxml></code><documentation>Copy the arc.</documentation></method></asyxml>*/
arc oa = new arc;
@@ -4882,7 +4903,7 @@ struct arc {
}
}/*<asyxml></struct></asyxml>*/
-/*<asyxml><function type = "polarconicroutine" signature = "polarconicroutine(ellipse)"><code></asyxml>*/
+/*<asyxml><function type="polarconicroutine" signature="polarconicroutine(ellipse)"><code></asyxml>*/
polarconicroutine polarconicroutine(conic co)
{/*<asyxml></code><documentation>Return the default routine used to draw a conic.</documentation></function></asyxml>*/
if(co.e == 0) return fromCenter;
@@ -4890,7 +4911,7 @@ polarconicroutine polarconicroutine(conic co)
return currentpolarconicroutine;
}
-/*<asyxml><function type = "arc" signature = "arc(ellipse, real, real, polarconicroutine, bool)"><code></asyxml>*/
+/*<asyxml><function type="arc" signature="arc(ellipse,real,real,polarconicroutine,bool)"><code></asyxml>*/
arc arc(ellipse el, real angle1, real angle2,
polarconicroutine polarconicroutine = polarconicroutine(el),
bool direction = CCW)
@@ -4900,7 +4921,7 @@ arc arc(ellipse el, real angle1, real angle2,
return oa;
}
-/*<asyxml><function type = "arc" signature = "complementary(arc)"><code></asyxml>*/
+/*<asyxml><function type="arc" signature="complementary(arc)"><code></asyxml>*/
arc complementary(arc a)
{/*<asyxml></code><documentation>Return the complementary of 'a'.</documentation></function></asyxml>*/
arc oa;
@@ -4908,7 +4929,7 @@ arc complementary(arc a)
return oa;
}
-/*<asyxml><function type = "arc" signature = "reverse(arc)"><code></asyxml>*/
+/*<asyxml><function type="arc" signature="reverse(arc)"><code></asyxml>*/
arc reverse(arc a)
{/*<asyxml></code><documentation>Return arc 'a' oriented in reverse direction.</documentation></function></asyxml>*/
arc oa;
@@ -4916,7 +4937,7 @@ arc reverse(arc a)
return oa;
}
-/*<asyxml><function type = "real" signature = "degrees(arc)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="degrees(arc)"><code></asyxml>*/
real degrees(arc a)
{/*<asyxml></code><documentation>Return the measure in degrees of the oriented arc 'a'.</documentation></function></asyxml>*/
real or;
@@ -4929,13 +4950,13 @@ real degrees(arc a)
return or;
}
-/*<asyxml><function type = "real" signature = "angle(a)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="angle(a)"><code></asyxml>*/
real angle(arc a)
{/*<asyxml></code><documentation>Return the measure in radians of the oriented arc 'a'.</documentation></function></asyxml>*/
return radians(degrees(a));
}
-/*<asyxml><function type = "int" signature = "arcnodesnumber(explicit arc)"><code></asyxml>*/
+/*<asyxml><function type="int" signature="arcnodesnumber(explicit arc)"><code></asyxml>*/
int arcnodesnumber(explicit arc a)
{/*<asyxml></code><documentation>Return the number of nodes to draw the arc 'a'.</documentation></function></asyxml>*/
return ellipsenodesnumber(a.el.a, a.el.b, a.angle1, a.angle2, a.direction);
@@ -4948,7 +4969,7 @@ private path arctopath(arc a, int n)
return arcfromfocus(a.el, a.angle1, a.angle2, n, a.direction);
}
-/*<asyxml><function type = "point" signature = "angpoint(arc, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="angpoint(arc,real)"><code></asyxml>*/
point angpoint(arc a, real angle)
{/*<asyxml></code><documentation>Return the point given by its angular position (in degrees) relative to the arc 'a'.
If 'angle > degrees(a)' or 'angle < 0' the returned point is on the extended arc.</documentation></function></asyxml>*/
@@ -4964,19 +4985,19 @@ point angpoint(arc a, real angle)
return point(coordsys(a.el), p/coordsys(a.el));
}
-/*<asyxml><operator type = "path" signature = "cast(explicit arc)"><code></asyxml>*/
+/*<asyxml><operator type = "path" signature="cast(explicit arc)"><code></asyxml>*/
path operator cast(explicit arc a)
{/*<asyxml></code><documentation>Cast arc to path.</documentation></operator></asyxml>*/
return arctopath(a, arcnodesnumber(a));
}
-/*<asyxml><operator type = "guide" signature = "cast(explicit arc)"><code></asyxml>*/
+/*<asyxml><operator type = "guide" signature="cast(explicit arc)"><code></asyxml>*/
guide operator cast(explicit arc a)
{/*<asyxml></code><documentation>Cast arc to guide.</documentation></operator></asyxml>*/
return arctopath(a, arcnodesnumber(a));
}
-/*<asyxml><operator type = "arc" signature = "*(transform, explicit arc)"><code></asyxml>*/
+/*<asyxml><operator type = "arc" signature="*(transform,explicit arc)"><code></asyxml>*/
arc operator *(transform t, explicit arc a)
{/*<asyxml></code><documentation>Provide transform * arc.</documentation></operator></asyxml>*/
pair[] P, PP;
@@ -5005,7 +5026,7 @@ arc operator *(transform t, explicit arc a)
return oa;
}
-/*<asyxml><operator type = "arc" signature = "*(real, explicit arc)"><code></asyxml>*/
+/*<asyxml><operator type = "arc" signature="*(real,explicit arc)"><code></asyxml>*/
arc operator *(real x, explicit arc a)
{/*<asyxml></code><documentation>Provide real * arc.
Return the arc subtracting and adding '(x - 1) * degrees(a)/2' to 'a.angle1' and 'a.angle2' respectively.</documentation></operator></asyxml>*/
@@ -5018,13 +5039,13 @@ arc operator *(real x, explicit arc a)
return oa;
}
arc operator *(int x, explicit arc a){return (real)x * a;}
-/*<asyxml><operator type = "arc" signature = "/(real, explicit arc)"><code></asyxml>*/
+/*<asyxml><operator type = "arc" signature="/(real,explicit arc)"><code></asyxml>*/
arc operator /(explicit arc a, real x)
{/*<asyxml></code><documentation>Provide arc/real.
Return the arc subtracting and adding '(1/x - 1) * degrees(a)/2' to 'a.angle1' and 'a.angle2' respectively.</documentation></operator></asyxml>*/
return (1/x) * a;
}
-/*<asyxml><operator type = "arc" signature = "+(explicit arc, point)"><code></asyxml>*/
+/*<asyxml><operator type = "arc" signature="+(explicit arc,point)"><code></asyxml>*/
arc operator +(explicit arc a, point M)
{/*<asyxml></code><documentation>Provide arc + point.
Return shifted arc.
@@ -5036,7 +5057,7 @@ arc operator +(explicit arc a, vector v){return shift(locate(v)) * a;}
arc operator -(explicit arc a, vector v){return a + (-v);}
-/*<asyxml><operator type = "bool" signature = "@(point, arc)"><code></asyxml>*/
+/*<asyxml><operator type = "bool" signature="@(point,arc)"><code></asyxml>*/
bool operator @(point M, arc a)
{/*<asyxml></code><documentation>Return true iff 'M' is on the arc 'a'.</documentation></operator></asyxml>*/
if (!(M @ a.el)) return false;
@@ -5046,7 +5067,7 @@ bool operator @(point M, arc a)
return sameside(M, point(R, point(ap, 1)), l);
}
-/*<asyxml><function type = "void" signature = "draw(picture, Label, arc, align, pen, arrowbar, arrowbar, margin, Label, marker)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="draw(picture,Label,arc,align,pen,arrowbar,arrowbar,margin,Label,marker)"><code></asyxml>*/
void draw(picture pic = currentpicture, Label L = "", arc a,
align align = NoAlign, pen p = currentpen,
arrowbar arrow = None, arrowbar bar = None, margin margin = NoMargin,
@@ -5056,7 +5077,7 @@ void draw(picture pic = currentpicture, Label L = "", arc a,
draw(pic, L, (path)a, align, addpenarc(p), arrow, bar, margin, legend, marker);
}
-/*<asyxml><function type = "real" signature = "arclength(arc)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="arclength(arc)"><code></asyxml>*/
real arclength(arc a)
{/*<asyxml></code><documentation>The arc length of 'a'.</documentation></function></asyxml>*/
return arclength(a.el, a.angle1, a.angle2, a.direction, a.polarconicroutine);
@@ -5125,7 +5146,7 @@ private point ppoint(arc a, real x)
return oP;
}
-/*<asyxml><function type = "point" signature = "point(arc, abscissa)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(arc,abscissa)"><code></asyxml>*/
point point(arc a, abscissa l)
{/*<asyxml></code><documentation>Return the point of 'a' which has the abscissa 'l.x'
according to the abscissa system 'l.system'.
@@ -5158,7 +5179,7 @@ point point(arc a, abscissa l)
}
-/*<asyxml><function type = "point" signature = "point(arc, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(arc,real)"><code></asyxml>*/
point point(arc a, real x)
{/*<asyxml></code><documentation>Return the point between node floor(t) and floor(t) + 1.</documentation></function></asyxml>*/
return point(a, nodabscissa(x));
@@ -5168,21 +5189,21 @@ pair point(explicit arc a, int x)
return point(a, nodabscissa(x));
}
-/*<asyxml><function type = "point" signature = "relpoint(arc, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="relpoint(arc,real)"><code></asyxml>*/
point relpoint(arc a, real x)
{/*<asyxml></code><documentation>Return the relative point of 'a'.
If x > 1 or x < 0, the returned point is on the extended arc.</documentation></function></asyxml>*/
return point(a, relabscissa(x));
}
-/*<asyxml><function type = "point" signature = "curpoint(arc, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="curpoint(arc,real)"><code></asyxml>*/
point curpoint(arc a, real x)
{/*<asyxml></code><documentation>Return the point of 'a' which has the curvilinear abscissa 'x'.
If x < 0 or x > arclength(a), the returned point is on the extended arc.</documentation></function></asyxml>*/
return point(a, curabscissa(x));
}
-/*<asyxml><function type = "abscissa" signature = "angabscissa(arc, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="angabscissa(arc,point)"><code></asyxml>*/
abscissa angabscissa(arc a, point M)
{/*<asyxml></code><documentation>Return the angular abscissa of 'M' according to the arc 'a'.</documentation></function></asyxml>*/
if(!(M @ a.el))
@@ -5196,7 +5217,7 @@ abscissa angabscissa(arc a, point M)
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "curabscissa(arc, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="curabscissa(arc,point)"><code></asyxml>*/
abscissa curabscissa(arc a, point M)
{/*<asyxml></code><documentation>Return the curvilinear abscissa according to the arc 'a'.</documentation></function></asyxml>*/
ellipse el = a.el;
@@ -5213,7 +5234,7 @@ abscissa curabscissa(arc a, point M)
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "nodabscissa(arc, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="nodabscissa(arc,point)"><code></asyxml>*/
abscissa nodabscissa(arc a, point M)
{/*<asyxml></code><documentation>Return the node abscissa according to the arc 'a'.</documentation></function></asyxml>*/
if(!(M @ a))
@@ -5224,7 +5245,7 @@ abscissa nodabscissa(arc a, point M)
return oa;
}
-/*<asyxml><function type = "abscissa" signature = "relabscissa(arc, point)"><code></asyxml>*/
+/*<asyxml><function type="abscissa" signature="relabscissa(arc,point)"><code></asyxml>*/
abscissa relabscissa(arc a, point M)
{/*<asyxml></code><documentation>Return the relative abscissa according to the arc 'a'.</documentation></function></asyxml>*/
ellipse el = a.el;
@@ -5236,7 +5257,7 @@ abscissa relabscissa(arc a, point M)
return oa;
}
-/*<asyxml><function type = "void" signature = "markarc(picture, Label, int, real, real, arc, arrowbar, pen, pen, margin, marker)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="markarc(picture,Label,int,real,real,arc,arrowbar,pen,pen,margin,marker)"><code></asyxml>*/
void markarc(picture pic = currentpicture,
Label L = "",
int n = 1, real radius = 0, real space = 0,
@@ -5265,13 +5286,13 @@ void markarc(picture pic = currentpicture,
// *=======================================================*
// *........................MASSES.........................*
-/*<asyxml><struct signature = "mass"><code></asyxml>*/
-struct mass {/*<asyxml></code><documentation></documentation><property type = "point" signature = "M"><code></asyxml>*/
- point M;/*<asyxml></code><documentation></documentation></property><property type = "real" signature = "m"><code></asyxml>*/
+/*<asyxml><struct signature="mass"><code></asyxml>*/
+struct mass {/*<asyxml></code><documentation></documentation><property type = "point" signature="M"><code></asyxml>*/
+ point M;/*<asyxml></code><documentation></documentation></property><property type = "real" signature="m"><code></asyxml>*/
real m;/*<asyxml></code><documentation></documentation></property></asyxml>*/
}/*<asyxml></struct></asyxml>*/
-/*<asyxml><function type = "mass" signature = "mass(point, real)"><code></asyxml>*/
+/*<asyxml><function type="mass" signature="mass(point,real)"><code></asyxml>*/
mass mass(point M, real m)
{/*<asyxml></code><documentation>Constructor of mass point.</documentation></function></asyxml>*/
mass om;
@@ -5280,7 +5301,7 @@ mass mass(point M, real m)
return om;
}
-/*<asyxml><operator type = "point" signature = "cast(mass)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="cast(mass)"><code></asyxml>*/
point operator cast(mass m)
{/*<asyxml></code><documentation>Cast mass point to point.</documentation></operator></asyxml>*/
point op;
@@ -5288,11 +5309,11 @@ point operator cast(mass m)
op.m = m.m;
return op;
}
-/*<asyxml><function type = "point" signature = "point(explicit mass)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(explicit mass)"><code></asyxml>*/
point point(explicit mass m){return m;}/*<asyxml></code><documentation>Cast
'm' to point</documentation></function></asyxml>*/
-/*<asyxml><operator type = "mass" signature = "cast(point)"><code></asyxml>*/
+/*<asyxml><operator type = "mass" signature="cast(point)"><code></asyxml>*/
mass operator cast(point M)
{/*<asyxml></code><documentation>Cast point to mass point.</documentation></operator></asyxml>*/
mass om;
@@ -5300,13 +5321,13 @@ mass operator cast(point M)
om.m = M.m;
return om;
}
-/*<asyxml><function type = "mass" signature = "mass(explicit point)"><code></asyxml>*/
+/*<asyxml><function type="mass" signature="mass(explicit point)"><code></asyxml>*/
mass mass(explicit point P)
{/*<asyxml></code><documentation>Cast 'P' to mass.</documentation></function></asyxml>*/
return mass(P, P.m);
}
-/*<asyxml><operator type = "point[]" signature = "cast(mass[])"><code></asyxml>*/
+/*<asyxml><operator type = "point[]" signature="cast(mass[])"><code></asyxml>*/
point[] operator cast(mass[] m)
{/*<asyxml></code><documentation>Cast mass[] to point[].</documentation></operator></asyxml>*/
point[] op;
@@ -5314,7 +5335,7 @@ point[] operator cast(mass[] m)
return op;
}
-/*<asyxml><operator type = "mass[]" signature = "cast(point[])"><code></asyxml>*/
+/*<asyxml><operator type = "mass[]" signature="cast(point[])"><code></asyxml>*/
mass[] operator cast(point[] P)
{/*<asyxml></code><documentation>Cast point[] to mass[].</documentation></operator></asyxml>*/
mass[] om;
@@ -5322,21 +5343,21 @@ mass[] operator cast(point[] P)
return om;
}
-/*<asyxml><function type = "mass" signature = "mass(coordsys, explicit pair, real)"><code></asyxml>*/
+/*<asyxml><function type="mass" signature="mass(coordsys,explicit pair,real)"><code></asyxml>*/
mass mass(coordsys R, explicit pair p, real m)
{/*<asyxml></code><documentation>Return the mass which has coordinates
'p' with respect to 'R' and weight 'm'.</documentation></function></asyxml>*/
return point(R, p, m);// Using casting.
}
-/*<asyxml><operator type = "mass" signature = "cast(pair)"><code></asyxml>*/
+/*<asyxml><operator type = "mass" signature="cast(pair)"><code></asyxml>*/
mass operator cast(pair m){return mass((point)m, 1);}/*<asyxml></code><documentation>Cast pair to mass point.</documentation></operator></asyxml>*/
-/*<asyxml><operator type = "path" signature = "cast(mass)"><code></asyxml>*/
+/*<asyxml><operator type = "path" signature="cast(mass)"><code></asyxml>*/
path operator cast(mass M){return M.M;}/*<asyxml></code><documentation>Cast mass point to path.</documentation></operator></asyxml>*/
-/*<asyxml><operator type = "guide" signature = "cast(mass)"><code></asyxml>*/
+/*<asyxml><operator type = "guide" signature="cast(mass)"><code></asyxml>*/
guide operator cast(mass M){return M.M;}/*<asyxml></code><documentation>Cast mass to guide.</documentation></operator></asyxml>*/
-/*<asyxml><operator type = "mass" signature = "+(mass, mass)"><code></asyxml>*/
+/*<asyxml><operator type = "mass" signature="+(mass,mass)"><code></asyxml>*/
mass operator +(mass M1, mass M2)
{/*<asyxml></code><documentation>Provide mass + mass.
mass - mass is also defined.</documentation></operator></asyxml>*/
@@ -5347,7 +5368,7 @@ mass operator -(mass M1, mass M2)
return mass(M1.M - M2.M, M1.m - M2.m);
}
-/*<asyxml><operator type = "mass" signature = "*(real, mass)"><code></asyxml>*/
+/*<asyxml><operator type = "mass" signature="*(real,mass)"><code></asyxml>*/
mass operator *(real x, explicit mass M)
{/*<asyxml></code><documentation>Provide real * mass.
The resulted mass is the mass of 'M' multiplied by 'x' .
@@ -5361,13 +5382,13 @@ mass operator +(explicit mass M, real x){return mass(M.M, M.m + x);}
mass operator +(explicit mass M, int x){return mass(M.M, M.m + x);}
mass operator -(explicit mass M, real x){return mass(M.M, M.m - x);}
mass operator -(explicit mass M, int x){return mass(M.M, M.m - x);}
-/*<asyxml><operator type = "mass" signature = "*(transform, mass)"><code></asyxml>*/
+/*<asyxml><operator type = "mass" signature="*(transform,mass)"><code></asyxml>*/
mass operator *(transform t, mass M)
{/*<asyxml></code><documentation>Provide transform * mass.</documentation></operator></asyxml>*/
return mass(t * M.M, M.m);
}
-/*<asyxml><function type = "mass" signature = "masscenter(... mass[])"><code></asyxml>*/
+/*<asyxml><function type="mass" signature="masscenter(... mass[])"><code></asyxml>*/
mass masscenter(... mass[] M)
{/*<asyxml></code><documentation>Return the center of the masses 'M'.</documentation></function></asyxml>*/
point[] P;
@@ -5384,7 +5405,7 @@ mass masscenter(... mass[] M)
return mass(oM/m, m);
}
-/*<asyxml><function type = "string" signature = "massformat(string, string, mass)"><code></asyxml>*/
+/*<asyxml><function type="string" signature="massformat(string,string,mass)"><code></asyxml>*/
string massformat(string format = defaultmassformat,
string s, mass M)
{/*<asyxml></code><documentation>Return the string formated by 'format' with the mass value.
@@ -5394,7 +5415,7 @@ string massformat(string format = defaultmassformat,
format(replace(format, "%L", replace(s, "$", "")), M.m);
}
-/*<asyxml><function type = "void" signature = "label(picture, Label, explicit mass, align, string, pen, filltype)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="label(picture,Label,explicit mass,align,string,pen,filltype)"><code></asyxml>*/
void label(picture pic = currentpicture, Label L, explicit mass M,
align align = NoAlign, string format = defaultmassformat,
pen p = nullpen, filltype filltype = NoFill)
@@ -5406,7 +5427,7 @@ void label(picture pic = currentpicture, Label L, explicit mass M,
add(pic, L);
}
-/*<asyxml><function type = "void" signature = "dot(picture, Label, explicit mass, align, string, pen)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="dot(picture,Label,explicit mass,align,string,pen)"><code></asyxml>*/
void dot(picture pic = currentpicture, Label L, explicit mass M, align align = NoAlign,
string format = defaultmassformat, pen p = currentpen)
{/*<asyxml></code><documentation>Draw a dot with label 'L' as
@@ -5425,7 +5446,7 @@ void dot(picture pic = currentpicture, Label L, explicit mass M, align align = N
// *=======================================================*
// *.......................TRIANGLES.......................*
-/*<asyxml><function type = "point" signature = "orthocentercenter(point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="orthocentercenter(point,point,point)"><code></asyxml>*/
point orthocentercenter(point A, point B, point C)
{/*<asyxml></code><documentation>Return the orthocenter of the triangle ABC.</documentation></function></asyxml>*/
point[] P = standardizecoordsys(A, B, C);
@@ -5434,13 +5455,13 @@ point orthocentercenter(point A, point B, point C)
return point(R, pp/R);
}
-/*<asyxml><function type = "point" signature = "centroid(point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="centroid(point,point,point)"><code></asyxml>*/
point centroid(point A, point B, point C)
{/*<asyxml></code><documentation>Return the centroid of the triangle ABC.</documentation></function></asyxml>*/
return (A + B + C)/3;
}
-/*<asyxml><function type = "point" signature = "incenter(point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="incenter(point,point,point)"><code></asyxml>*/
point incenter(point A, point B, point C)
{/*<asyxml></code><documentation>Return the center of the incircle of the triangle ABC.</documentation></function></asyxml>*/
point[] P = standardizecoordsys(A, B, C);
@@ -5450,21 +5471,21 @@ point incenter(point A, point B, point C)
return point(R, pp/R);
}
-/*<asyxml><function type = "real" signature = "inradius(point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="inradius(point,point,point)"><code></asyxml>*/
real inradius(point A, point B, point C)
{/*<asyxml></code><documentation>Return the radius of the incircle of the triangle ABC.</documentation></function></asyxml>*/
point IC = incenter(A, B, C);
return abs(IC - projection(A, B) * IC);
}
-/*<asyxml><function type = "circle" signature = "incircle(point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="circle" signature="incircle(point,point,point)"><code></asyxml>*/
circle incircle(point A, point B, point C)
{/*<asyxml></code><documentation>Return the incircle of the triangle ABC.</documentation></function></asyxml>*/
point IC = incenter(A, B, C);
return circle(IC, abs(IC - projection(A, B) * IC));
}
-/*<asyxml><function type = "point" signature = "excenter(point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="excenter(point,point,point)"><code></asyxml>*/
point excenter(point A, point B, point C)
{/*<asyxml></code><documentation>Return the center of the excircle of the triangle tangent with (AB).</documentation></function></asyxml>*/
point[] P = standardizecoordsys(A, B, C);
@@ -5474,14 +5495,14 @@ point excenter(point A, point B, point C)
return point(R, pp/R);
}
-/*<asyxml><function type = "real" signature = "exradius(point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="exradius(point,point,point)"><code></asyxml>*/
real exradius(point A, point B, point C)
{/*<asyxml></code><documentation>Return the radius of the excircle of the triangle ABC with (AB).</documentation></function></asyxml>*/
point EC = excenter(A, B, C);
return abs(EC - projection(A, B) * EC);
}
-/*<asyxml><function type = "circle" signature = "excircle(point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="circle" signature="excircle(point,point,point)"><code></asyxml>*/
circle excircle(point A, point B, point C)
{/*<asyxml></code><documentation>Return the excircle of the triangle ABC tangent with (AB).</documentation></function></asyxml>*/
point center = excenter(A, B, C);
@@ -5492,22 +5513,22 @@ circle excircle(point A, point B, point C)
private int[] numarray = {1, 2, 3};
numarray.cyclic = true;
-/*<asyxml><struct signature = "triangle"><code></asyxml>*/
+/*<asyxml><struct signature="triangle"><code></asyxml>*/
struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/
- /*<asyxml><struct signature = "vertex"><code></asyxml>*/
- struct vertex {/*<asyxml></code><documentation>Structure used to communicate the vertex of a triangle.</documentation><property type = "int" signature = "n"><code></asyxml>*/
- int n;/*<asyxml></code><documentation>1 means VA, 2 means VB, 3 means VC, 4 means VA etc...</documentation></property><property type = "triangle" signature = "triangle"><code></asyxml>*/
+ /*<asyxml><struct signature="vertex"><code></asyxml>*/
+ struct vertex {/*<asyxml></code><documentation>Structure used to communicate the vertex of a triangle.</documentation><property type = "int" signature="n"><code></asyxml>*/
+ int n;/*<asyxml></code><documentation>1 means VA,2 means VB,3 means VC,4 means VA etc...</documentation></property><property type = "triangle" signature="triangle"><code></asyxml>*/
triangle t;/*<asyxml></code><documentation>The triangle to which the vertex refers.</documentation></property></asyxml>*/
}/*<asyxml></struct></asyxml>*/
- /*<asyxml><property type = "point" signature = "A, B, C"><code></asyxml>*/
- restricted point A, B, C;/*<asyxml></code><documentation>The vertices of the triangle (as point).</documentation></property><property type = "vertex" signature = "VA, VB, VC"><code></asyxml>*/
+ /*<asyxml><property type = "point" signature="A,B,C"><code></asyxml>*/
+ restricted point A, B, C;/*<asyxml></code><documentation>The vertices of the triangle (as point).</documentation></property><property type = "vertex" signature="VA, VB, VC"><code></asyxml>*/
restricted vertex VA, VB, VC;/*<asyxml></code><documentation>The vertices of the triangle (as vertex).
Note that the vertex structure contains the triangle to wish it refers.</documentation></property></asyxml>*/
VA.n = 1;VB.n = 2;VC.n = 3;
- /*<asyxml><method type = "vertex" signature = "vertex(int)"><code></asyxml>*/
+ /*<asyxml><method type = "vertex" signature="vertex(int)"><code></asyxml>*/
vertex vertex(int n)
{/*<asyxml></code><documentation>Return numbered vertex.
'n' is 1 means VA, 2 means VB, 3 means VC, 4 means VA etc...</documentation></method></asyxml>*/
@@ -5517,7 +5538,7 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/
return VC;
}
- /*<asyxml><method type = "point" signature = "point(int)"><code></asyxml>*/
+ /*<asyxml><method type = "point" signature="point(int)"><code></asyxml>*/
point point(int n)
{/*<asyxml></code><documentation>Return numbered point.
n is 1 means A, 2 means B, 3 means C, 4 means A etc...</documentation></method></asyxml>*/
@@ -5527,7 +5548,7 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/
return C;
}
- /*<asyxml><method type = "void" signature = "init(point, point, point)"><code></asyxml>*/
+ /*<asyxml><method type = "void" signature="init(point,point,point)"><code></asyxml>*/
void init(point A, point B, point C)
{/*<asyxml></code><documentation>Constructor.</documentation></method></asyxml>*/
point[] P = standardizecoordsys(A, B, C);
@@ -5537,14 +5558,14 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/
VA.t = this; VB.t = this; VC.t = this;
}
- /*<asyxml><method type = "void" signature = "operator init(point, point, point)"><code></asyxml>*/
+ /*<asyxml><method type = "void" signature="operator init(point,point,point)"><code></asyxml>*/
void operator init(point A, point B, point C)
{/*<asyxml></code><documentation>For backward compatibility.
Provide the routine 'triangle(point A, point B, point C)'.</documentation></method></asyxml>*/
this.init(A, B, C);
}
- /*<asyxml><method type = "void" signature = "init(real, real, real, real, point)"><code></asyxml>*/
+ /*<asyxml><method type = "void" signature="init(real,real,real,real,point)"><code></asyxml>*/
void operator init(real b, real alpha, real c, real angle = 0, point A = (0, 0))
{/*<asyxml></code><documentation>For backward compatibility.
Provide the routine 'triangle(real b, real alpha, real c, real angle = 0, point A = (0, 0))
@@ -5553,7 +5574,7 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/
this.init(A, A + R.polar(c, radians(angle)), A + R.polar(b, radians(angle + alpha)));
}
- /*<asyxml><method type = "real" signature = "a(), b(), c()"><code></asyxml>*/
+ /*<asyxml><method type = "real" signature="a(),b(),c()"><code></asyxml>*/
real a()
{/*<asyxml></code><documentation>Return the length BC.
b() and c() are also defined and return the length AC and AB respectively.</documentation></method></asyxml>*/
@@ -5564,14 +5585,14 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/
private real det(pair a, pair b) {return a.x * b.y - a.y * b.x;}
- /*<asyxml><method type = "real" signature = "area()"><code></asyxml>*/
+ /*<asyxml><method type = "real" signature="area()"><code></asyxml>*/
real area()
{/*<asyxml></code><documentation></documentation></method></asyxml>*/
pair a = locate(A), b = locate(B), c = locate(C);
return 0.5 * abs(det(a, b) + det(b, c) + det(c, a));
}
- /*<asyxml><method type = "real" signature = "alpha(), beta(), gamma()"><code></asyxml>*/
+ /*<asyxml><method type = "real" signature="alpha(),beta(),gamma()"><code></asyxml>*/
real alpha()
{/*<asyxml></code><documentation>Return the measure (in degrees) of the angle A.
beta() and gamma() are also defined and return the measure of the angles B and C respectively.</documentation></method></asyxml>*/
@@ -5580,20 +5601,20 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/
real beta() {return degrees(acos((c()^2 + a()^2 - b()^2)/(2c() * a())));}
real gamma() {return degrees(acos((a()^2 + b()^2 - c()^2)/(2a() * b())));}
- /*<asyxml><method type = "path" signature = "Path()"><code></asyxml>*/
+ /*<asyxml><method type = "path" signature="Path()"><code></asyxml>*/
path Path()
{/*<asyxml></code><documentation>The path of the triangle.</documentation></method></asyxml>*/
return A--C--B--cycle;
}
- /*<asyxml><struct signature = "side"><code></asyxml>*/
+ /*<asyxml><struct signature="side"><code></asyxml>*/
struct side
- {/*<asyxml></code><documentation>Structure used to communicate the side of a triangle.</documentation><property type = "int" signature = "n"><code></asyxml>*/
- int n;/*<asyxml></code><documentation>1 or 0 means [AB], -1 means [BA], 2 means [BC], -2 means [CB] etc.</documentation></property><property type = "triangle" signature = "triangle"><code></asyxml>*/
+ {/*<asyxml></code><documentation>Structure used to communicate the side of a triangle.</documentation><property type = "int" signature="n"><code></asyxml>*/
+ int n;/*<asyxml></code><documentation>1 or 0 means [AB],-1 means [BA],2 means [BC],-2 means [CB] etc.</documentation></property><property type = "triangle" signature="triangle"><code></asyxml>*/
triangle t;/*<asyxml></code><documentation>The triangle to which the side refers.</documentation></property></asyxml>*/
}/*<asyxml></struct></asyxml>*/
- /*<asyxml><property type = "side" signature = "AB"><code></asyxml>*/
+ /*<asyxml><property type = "side" signature="AB"><code></asyxml>*/
side AB;/*<asyxml></code><documentation>For the routines using the structure 'side', triangle.AB means 'side AB'.
BA, AC, CA etc are also defined.</documentation></property></asyxml>*/
AB.n = 1; AB.t = this;
@@ -5603,7 +5624,7 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/
side CA; CA.n = 3; CA.t = this;
side AC; AC.n = -3; AC.t = this;
- /*<asyxml><method type = "side" signature = "side(int)"><code></asyxml>*/
+ /*<asyxml><method type = "side" signature="side(int)"><code></asyxml>*/
side side(int n)
{/*<asyxml></code><documentation>Return numbered side.
n is 1 means AB, -1 means BA, 2 means BC, -2 means CB, etc.</documentation></method></asyxml>*/
@@ -5614,7 +5635,7 @@ struct triangle {/*<asyxml></code><documentation></documentation></asyxml>*/
return n > 0 ? CA : AC;
}
- /*<asyxml><method type = "line" signature = "line(int)"><code></asyxml>*/
+ /*<asyxml><method type = "line" signature="line(int)"><code></asyxml>*/
line line(int n)
{/*<asyxml></code><documentation>Return the numbered line.</documentation></method></asyxml>*/
if(n == 0) abort('Invalid line number.');
@@ -5646,7 +5667,7 @@ triangle[] operator ^^(... triangle[] t)
return T;
}
-/*<asyxml><operator type = "line" signature = "cast(side)"><code></asyxml>*/
+/*<asyxml><operator type = "line" signature="cast(side)"><code></asyxml>*/
line operator cast(side side)
{/*<asyxml></code><documentation>Cast side to (infinite) line.
Most routine with line parameters works with side parameters.
@@ -5655,56 +5676,56 @@ line operator cast(side side)
return t.line(side.n);
}
-/*<asyxml><function type = "line" signature = "line(explicit side)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="line(explicit side)"><code></asyxml>*/
line line(explicit side side)
{/*<asyxml></code><documentation>Return 'side' as line.</documentation></function></asyxml>*/
return (line)side;
}
-/*<asyxml><function type = "segment" signature = "segment(explicit side)"><code></asyxml>*/
+/*<asyxml><function type="segment" signature="segment(explicit side)"><code></asyxml>*/
segment segment(explicit side side)
{/*<asyxml></code><documentation>Return 'side' as segment.</documentation></function></asyxml>*/
return (segment)(line)side;
}
-/*<asyxml><operator type = "point" signature = "cast(vertex)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="cast(vertex)"><code></asyxml>*/
point operator cast(vertex V)
{/*<asyxml></code><documentation>Cast vertex to point.
Most routine with point parameters works with vertex parameters.</documentation></operator></asyxml>*/
return V.t.point(V.n);
}
-/*<asyxml><function type = "point" signature = "point(explicit vertex)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(explicit vertex)"><code></asyxml>*/
point point(explicit vertex V)
{/*<asyxml></code><documentation>Return the point corresponding to the vertex 'V'.</documentation></function></asyxml>*/
return (point)V;
}
-/*<asyxml><function type = "side" signature = "opposite(vertex)"><code></asyxml>*/
+/*<asyxml><function type="side" signature="opposite(vertex)"><code></asyxml>*/
side opposite(vertex V)
{/*<asyxml></code><documentation>Return the opposite side of vertex 'V'.</documentation></function></asyxml>*/
return V.t.side(numarray[abs(V.n)]);
}
-/*<asyxml><function type = "vertex" signature = "opposite(side)"><code></asyxml>*/
+/*<asyxml><function type="vertex" signature="opposite(side)"><code></asyxml>*/
vertex opposite(side side)
{/*<asyxml></code><documentation>Return the opposite vertex of side 'side'.</documentation></function></asyxml>*/
return side.t.vertex(numarray[abs(side.n) + 1]);
}
-/*<asyxml><function type = "point" signature = "midpoint(side)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="midpoint(side)"><code></asyxml>*/
point midpoint(side side)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
return midpoint(segment(side));
}
-/*<asyxml><operator type = "triangle" signature = "*(transform, triangle)"><code></asyxml>*/
+/*<asyxml><operator type = "triangle" signature="*(transform,triangle)"><code></asyxml>*/
triangle operator *(transform T, triangle t)
{/*<asyxml></code><documentation>Provide transform * triangle.</documentation></operator></asyxml>*/
return triangle(T * t.A, T * t.B, T * t.C);
}
-/*<asyxml><function type = "triangle" signature = "triangleAbc(real, real, real, real, point)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="triangleAbc(real,real,real,real,point)"><code></asyxml>*/
triangle triangleAbc(real alpha, real b, real c, real angle = 0, point A = (0, 0))
{/*<asyxml></code><documentation>Return the triangle ABC rotated by 'angle' with BAC = alpha, AC = b and AB = c.</documentation></function></asyxml>*/
triangle T;
@@ -5713,7 +5734,7 @@ triangle triangleAbc(real alpha, real b, real c, real angle = 0, point A = (0, 0
return T;
}
-/*<asyxml><function type = "triangle" signature = "triangleabc(real, real, real, real, point)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="triangleabc(real,real,real,real,point)"><code></asyxml>*/
triangle triangleabc(real a, real b, real c, real angle = 0, point A = (0, 0))
{/*<asyxml></code><documentation>Return the triangle ABC rotated by 'angle' with BC = a, AC = b and AB = c.</documentation></function></asyxml>*/
triangle T;
@@ -5722,7 +5743,7 @@ triangle triangleabc(real a, real b, real c, real angle = 0, point A = (0, 0))
return T;
}
-/*<asyxml><function type = "triangle" signature = "triangle(line, line, line)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="triangle(line,line,line)"><code></asyxml>*/
triangle triangle(line l1, line l2, line l3)
{/*<asyxml></code><documentation>Return the triangle defined by three line.</documentation></function></asyxml>*/
point P1, P2, P3;
@@ -5733,79 +5754,79 @@ triangle triangle(line l1, line l2, line l3)
return triangle(P1, P2, P3);
}
-/*<asyxml><function type = "point" signature = "foot(vertex)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="foot(vertex)"><code></asyxml>*/
point foot(vertex V)
{/*<asyxml></code><documentation>Return the endpoint of the altitude from V.</documentation></function></asyxml>*/
return projection((line)opposite(V)) * ((point)V);
}
-/*<asyxml><function type = "point" signature = "foot(side)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="foot(side)"><code></asyxml>*/
point foot(side side)
{/*<asyxml></code><documentation>Return the endpoint of the altitude on 'side'.</documentation></function></asyxml>*/
return projection((line)side) * point(opposite(side));
}
-/*<asyxml><function type = "line" signature = "altitude(vertex)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="altitude(vertex)"><code></asyxml>*/
line altitude(vertex V)
{/*<asyxml></code><documentation>Return the altitude passing through 'V'.</documentation></function></asyxml>*/
return line(point(V), foot(V));
}
-/*<asyxml><function type = "line" signature = "altitude(vertex)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="altitude(vertex)"><code></asyxml>*/
line altitude(side side)
{/*<asyxml></code><documentation>Return the altitude cutting 'side'.</documentation></function></asyxml>*/
return altitude(opposite(side));
}
-/*<asyxml><function type = "point" signature = "orthocentercenter(triangle)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="orthocentercenter(triangle)"><code></asyxml>*/
point orthocentercenter(triangle t)
{/*<asyxml></code><documentation>Return the orthocenter of the triangle t.</documentation></function></asyxml>*/
return orthocentercenter(t.A, t.B, t.C);
}
-/*<asyxml><function type = "point" signature = "centroid(triangle)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="centroid(triangle)"><code></asyxml>*/
point centroid(triangle t)
{/*<asyxml></code><documentation>Return the centroid of the triangle 't'.</documentation></function></asyxml>*/
return (t.A + t.B + t.C)/3;
}
-/*<asyxml><function type = "point" signature = "circumcenter(triangle)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="circumcenter(triangle)"><code></asyxml>*/
point circumcenter(triangle t)
{/*<asyxml></code><documentation>Return the circumcenter of the triangle 't'.</documentation></function></asyxml>*/
return circumcenter(t.A, t.B, t.C);
}
-/*<asyxml><function type = "circle" signature = "circle(triangle)"><code></asyxml>*/
+/*<asyxml><function type="circle" signature="circle(triangle)"><code></asyxml>*/
circle circle(triangle t)
{/*<asyxml></code><documentation>Return the circumcircle of the triangle 't'.</documentation></function></asyxml>*/
return circle(t.A, t.B, t.C);
}
-/*<asyxml><function type = "circle" signature = "circumcircle(triangle)"><code></asyxml>*/
+/*<asyxml><function type="circle" signature="circumcircle(triangle)"><code></asyxml>*/
circle circumcircle(triangle t)
{/*<asyxml></code><documentation>Return the circumcircle of the triangle 't'.</documentation></function></asyxml>*/
return circle(t.A, t.B, t.C);
}
-/*<asyxml><function type = "point" signature = "incenter(triangle)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="incenter(triangle)"><code></asyxml>*/
point incenter(triangle t)
{/*<asyxml></code><documentation>Return the center of the incircle of the triangle 't'.</documentation></function></asyxml>*/
return incenter(t.A, t.B, t.C);
}
-/*<asyxml><function type = "real" signature = "inradius(triangle)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="inradius(triangle)"><code></asyxml>*/
real inradius(triangle t)
{/*<asyxml></code><documentation>Return the radius of the incircle of the triangle 't'.</documentation></function></asyxml>*/
return inradius(t.A, t.B, t.C);
}
-/*<asyxml><function type = "circle" signature = "incircle(triangle)"><code></asyxml>*/
+/*<asyxml><function type="circle" signature="incircle(triangle)"><code></asyxml>*/
circle incircle(triangle t)
{/*<asyxml></code><documentation>Return the the incircle of the triangle 't'.</documentation></function></asyxml>*/
return incircle(t.A, t.B, t.C);
}
-/*<asyxml><function type = "point" signature = "excenter(side, triangle)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="excenter(side,triangle)"><code></asyxml>*/
point excenter(side side)
{/*<asyxml></code><documentation>Return the center of the excircle tangent with the side 'side' of its triangle.
side = 0 means AB, 1 means AC, other means BC.
@@ -5819,7 +5840,7 @@ point excenter(side side)
return op;
}
-/*<asyxml><function type = "real" signature = "exradius(side, triangle)"><code></asyxml>*/
+/*<asyxml><function type="real" signature="exradius(side,triangle)"><code></asyxml>*/
real exradius(side side)
{/*<asyxml></code><documentation>Return radius of the excircle tangent with the side 'side' of its triangle.
side = 0 means AB, 1 means BC, other means CA.
@@ -5833,7 +5854,7 @@ real exradius(side side)
return or;
}
-/*<asyxml><function type = "circle" signature = "excircle(side, triangle)"><code></asyxml>*/
+/*<asyxml><function type="circle" signature="excircle(side,triangle)"><code></asyxml>*/
circle excircle(side side)
{/*<asyxml></code><documentation>Return the excircle tangent with the side 'side' of its triangle.
side = 0 means AB, 1 means AC, other means BC.
@@ -5847,15 +5868,15 @@ circle excircle(side side)
return oc;
}
-/*<asyxml><struct signature = "trilinear"><code></asyxml>*/
+/*<asyxml><struct signature="trilinear"><code></asyxml>*/
struct trilinear
{/*<asyxml></code><documentation>Trilinear coordinates 'a:b:c' relative to triangle 't'.
- <url href = "http://mathworld.wolfram.com/TrilinearCoordinates.html"/></documentation><property type = "real" signature = "a, b, c"><code></asyxml>*/
- real a, b, c;/*<asyxml></code><documentation>The trilinear coordinates.</documentation></property><property type = "triangle" signature = "t"><code></asyxml>*/
+ <url href = "http://mathworld.wolfram.com/TrilinearCoordinates.html"/></documentation><property type = "real" signature="a,b,c"><code></asyxml>*/
+ real a,b,c;/*<asyxml></code><documentation>The trilinear coordinates.</documentation></property><property type = "triangle" signature="t"><code></asyxml>*/
triangle t;/*<asyxml></code><documentation>The reference triangle.</documentation></property></asyxml>*/
}/*<asyxml></struct></asyxml>*/
-/*<asyxml><function type = "trilinear" signature = "trilinear(triangle, real, real, real)"><code></asyxml>*/
+/*<asyxml><function type="trilinear" signature="trilinear(triangle,real,real,real)"><code></asyxml>*/
trilinear trilinear(triangle t, real a, real b, real c)
{/*<asyxml></code><documentation>Return the trilinear coordinates relative to 't'.
<url href = "http://mathworld.wolfram.com/TrilinearCoordinates.html"/></documentation></function></asyxml>*/
@@ -5865,7 +5886,7 @@ trilinear trilinear(triangle t, real a, real b, real c)
return ot;
}
-/*<asyxml><function type = "trilinear" signature = "trilinear(triangle, point)"><code></asyxml>*/
+/*<asyxml><function type="trilinear" signature="trilinear(triangle,point)"><code></asyxml>*/
trilinear trilinear(triangle t, point M)
{/*<asyxml></code><documentation>Return the trilinear coordinates of 'M' relative to 't'.
<url href = "http://mathworld.wolfram.com/TrilinearCoordinates.html"/></documentation></function></asyxml>*/
@@ -5889,13 +5910,13 @@ trilinear trilinear(triangle t, point M)
return ot;
}
-/*<asyxml><function type = "void" signature = "write(trilinear)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="write(trilinear)"><code></asyxml>*/
void write(trilinear tri)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
write(format("%f : ", tri.a) + format("%f : ", tri.b) + format("%f", tri.c));
}
-/*<asyxml><function type = "point" signature = "trilinear(triangle, real, real, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="trilinear(triangle,real,real,real)"><code></asyxml>*/
point point(trilinear tri)
{/*<asyxml></code><documentation>Return the trilinear coordinates relative to 't'.
<url href = "http://mathworld.wolfram.com/TrilinearCoordinates.html"/></documentation></function></asyxml>*/
@@ -5905,7 +5926,7 @@ point point(trilinear tri)
0.5 * t.c() * mass(t.C, tri.c));
}
-/*<asyxml><function type = "int[]" signature = "tricoef(side)"><code></asyxml>*/
+/*<asyxml><function type="int[]" signature="tricoef(side)"><code></asyxml>*/
int[] tricoef(side side)
{/*<asyxml></code><documentation>Return an array of integer (values are 0 or 1) which represents 'side'.
For example, side = t.BC will be represented by {0, 1, 1}.</documentation></function></asyxml>*/
@@ -5917,7 +5938,7 @@ int[] tricoef(side side)
return oi;
}
-/*<asyxml><operator type = "point" signature = "cast(trilinear)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="cast(trilinear)"><code></asyxml>*/
point operator cast(trilinear tri)
{/*<asyxml></code><documentation>Cast trilinear to point.
One may use the routine 'point(trilinear)' to force the casting.</documentation></operator></asyxml>*/
@@ -5927,13 +5948,13 @@ point operator cast(trilinear tri)
/*<asyxml><typedef type = "centerfunction" return = "real" params = "real, real, real"><code></asyxml>*/
typedef real centerfunction(real, real, real);/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/TriangleCenterFunction.html"/></documentation></typedef></asyxml>*/
-/*<asyxml><function type = "trilinear" signature = "trilinear(triangle, centerfunction, real, real, real)"><code></asyxml>*/
+/*<asyxml><function type="trilinear" signature="trilinear(triangle,centerfunction,real,real,real)"><code></asyxml>*/
trilinear trilinear(triangle t, centerfunction f, real a = t.a(), real b = t.b(), real c = t.c())
{/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/TriangleCenterFunction.html"/></documentation></function></asyxml>*/
return trilinear(t, f(a, b, c), f(b, c, a), f(c, a, b));
}
-/*<asyxml><function type = "point" signature = "symmedian(triangle)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="symmedian(triangle)"><code></asyxml>*/
point symmedian(triangle t)
{/*<asyxml></code><documentation>Return the symmedian point of 't'.</documentation></function></asyxml>*/
point A, B, C;
@@ -5943,7 +5964,7 @@ point symmedian(triangle t)
return intersectionpoint(line(t.A, A), line(t.B, B));
}
-/*<asyxml><function type = "point" signature = "symmedian(side)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="symmedian(side)"><code></asyxml>*/
point symmedian(side side)
{/*<asyxml></code><documentation>The symmedian point on the side 'side'.</documentation></function></asyxml>*/
triangle t = side.t;
@@ -5953,13 +5974,13 @@ point symmedian(side side)
return trilinear(t, t.a(), 0, t.c());
}
-/*<asyxml><function type = "line" signature = "symmedian(vertex)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="symmedian(vertex)"><code></asyxml>*/
line symmedian(vertex V)
{/*<asyxml></code><documentation>Return the symmedian passing through 'V'.</documentation></function></asyxml>*/
return line(point(V), symmedian(V.t));
}
-/*<asyxml><function type = "triangle" signature = "cevian(triangle, point)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="cevian(triangle,point)"><code></asyxml>*/
triangle cevian(triangle t, point P)
{/*<asyxml></code><documentation>Return the Cevian triangle with respect of 'P'
<url href = "http://mathworld.wolfram.com/CevianTriangle.html"/>.</documentation></function></asyxml>*/
@@ -5970,7 +5991,7 @@ triangle cevian(triangle t, point P)
return triangle(A, B, C);
}
-/*<asyxml><function type = "point" signature = "cevian(side, point)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="cevian(side,point)"><code></asyxml>*/
point cevian(side side, point P)
{/*<asyxml></code><documentation>Return the Cevian point on 'side' with respect of 'P'.</documentation></function></asyxml>*/
triangle t = side.t;
@@ -5979,20 +6000,20 @@ point cevian(side side, point P)
return point(trilinear(t, s[0] * tri.a, s[1] * tri.b, s[2] * tri.c));
}
-/*<asyxml><function type = "line" signature = "cevian(vertex, point)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="cevian(vertex,point)"><code></asyxml>*/
line cevian(vertex V, point P)
{/*<asyxml></code><documentation>Return line passing through 'V' and its Cevian image with respect of 'P'.</documentation></function></asyxml>*/
return line(point(V), cevian(opposite(V), P));
}
-/*<asyxml><function type = "point" signature = "gergonne(triangle)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="gergonne(triangle)"><code></asyxml>*/
point gergonne(triangle t)
{/*<asyxml></code><documentation>Return the Gergonne point of 't'.</documentation></function></asyxml>*/
real f(real a, real b, real c){return 1/(a * (b + c - a));}
return point(trilinear(t, f));
}
-/*<asyxml><function type = "point[]" signature = "fermat(triangle)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="fermat(triangle)"><code></asyxml>*/
point[] fermat(triangle t)
{/*<asyxml></code><documentation>Return the Fermat points of 't'.</documentation></function></asyxml>*/
point[] P;
@@ -6002,7 +6023,7 @@ point[] fermat(triangle t)
return P;
}
-/*<asyxml><function type = "point" signature = "isotomicconjugate(triangle, point)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="isotomicconjugate(triangle,point)"><code></asyxml>*/
point isotomicconjugate(triangle t, point M)
{/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/IsotomicConjugate.html"/></documentation></function></asyxml>*/
if(!inside(t.Path(), locate(M))) abort("isotomic: the point must be inside the triangle.");
@@ -6010,65 +6031,65 @@ point isotomicconjugate(triangle t, point M)
return point(trilinear(t, 1/(t.a()^2 * tr.a), 1/(t.b()^2 * tr.b), 1/(t.c()^2 * tr.c)));
}
-/*<asyxml><function type = "line" signature = "isotomic(vertex, point)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="isotomic(vertex,point)"><code></asyxml>*/
line isotomic(vertex V, point M)
{/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/IsotomicConjugate.html"/>.</documentation></function></asyxml>*/
side op = opposite(V);
return line(V, rotate(180, midpoint(op)) * cevian(op, M));
}
-/*<asyxml><function type = "point" signature = "isotomic(side, point)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="isotomic(side,point)"><code></asyxml>*/
point isotomic(side side, point M)
{/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/IsotomicConjugate.html"/></documentation></function></asyxml>*/
return intersectionpoint(isotomic(opposite(side), M), side);
}
-/*<asyxml><function type = "triangle" signature = "isotomic(triangle, point)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="isotomic(triangle,point)"><code></asyxml>*/
triangle isotomic(triangle t, point M)
{/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/IsotomicConjugate.html"/></documentation></function></asyxml>*/
return triangle(isotomic(t.BC, M), isotomic(t.CA, M), isotomic(t.AB, M));
}
-/*<asyxml><function type = "point" signature = "isogonalconjugate(triangle, point)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="isogonalconjugate(triangle,point)"><code></asyxml>*/
point isogonalconjugate(triangle t, point M)
{/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/IsogonalConjugate.html"/></documentation></function></asyxml>*/
trilinear tr = trilinear(t, M);
return point(trilinear(t, 1/tr.a, 1/tr.b, 1/tr.c));
}
-/*<asyxml><function type = "point" signature = "isogonal(side, point)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="isogonal(side,point)"><code></asyxml>*/
point isogonal(side side, point M)
{/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/IsogonalConjugate.html"/></documentation></function></asyxml>*/
return cevian(side, isogonalconjugate(side.t, M));
}
-/*<asyxml><function type = "line" signature = "isogonal(vertex, point)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="isogonal(vertex,point)"><code></asyxml>*/
line isogonal(vertex V, point M)
{/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/IsogonalConjugate.html"/></documentation></function></asyxml>*/
return line(V, isogonal(opposite(V), M));
}
-/*<asyxml><function type = "triangle" signature = "isogonal(triangle, point)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="isogonal(triangle,point)"><code></asyxml>*/
triangle isogonal(triangle t, point M)
{/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/IsogonalConjugate.html"/></documentation></function></asyxml>*/
return triangle(isogonal(t.BC, M), isogonal(t.CA, M), isogonal(t.AB, M));
}
-/*<asyxml><function type = "triangle" signature = "pedal(triangle, point)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="pedal(triangle,point)"><code></asyxml>*/
triangle pedal(triangle t, point M)
{/*<asyxml></code><documentation>Return the pedal triangle of 'M' in 't'.
<url href = "http://mathworld.wolfram.com/PedalTriangle.html"/></documentation></function></asyxml>*/
return triangle(projection(t.BC) * M, projection(t.AC) * M, projection(t.AB) * M);
}
-/*<asyxml><function type = "triangle" signature = "pedal(triangle, point)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="pedal(triangle,point)"><code></asyxml>*/
line pedal(side side, point M)
{/*<asyxml></code><documentation>Return the pedal line of 'M' cutting 'side'.
<url href = "http://mathworld.wolfram.com/PedalTriangle.html"/></documentation></function></asyxml>*/
return line(M, projection(side) * M);
}
-/*<asyxml><function type = "triangle" signature = "antipedal(triangle, point)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="antipedal(triangle,point)"><code></asyxml>*/
triangle antipedal(triangle t, point M)
{/*<asyxml></code><documentation><url href = "http://mathworld.wolfram.com/AntipedalTriangle.html"/></documentation></function></asyxml>*/
trilinear Tm = trilinear(t, M);
@@ -6080,7 +6101,7 @@ triangle antipedal(triangle t, point M)
return triangle(A, B, C);
}
-/*<asyxml><function type = "triangle" signature = "extouch(triangle)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="extouch(triangle)"><code></asyxml>*/
triangle extouch(triangle t)
{/*<asyxml></code><documentation>Return the extouch triangle of the triangle 't'.
The extouch triangle of 't' is the triangle formed by the points
@@ -6093,7 +6114,7 @@ triangle extouch(triangle t)
return triangle(A, B, C);
}
-/*<asyxml><function type = "triangle" signature = "extouch(triangle)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="extouch(triangle)"><code></asyxml>*/
triangle incentral(triangle t)
{/*<asyxml></code><documentation>Return the incentral triangle of the triangle 't'.
It is the triangle whose vertices are determined by the intersections of the
@@ -6106,7 +6127,7 @@ triangle incentral(triangle t)
return triangle(A, B, C);
}
-/*<asyxml><function type = "triangle" signature = "extouch(side)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="extouch(side)"><code></asyxml>*/
triangle extouch(side side)
{/*<asyxml></code><documentation>Return the triangle formed by the points of tangency of the triangle referenced by 'side' with its excircles.
One vertex of the returned triangle is on the segment 'side'.</documentation></function></asyxml>*/
@@ -6118,7 +6139,7 @@ triangle extouch(side side)
return triangle(p3 * EP, p2 * EP, p1 * EP);
}
-/*<asyxml><function type = "point" signature = "bisectorpoint(side)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="bisectorpoint(side)"><code></asyxml>*/
point bisectorpoint(side side)
{/*<asyxml></code><documentation>The intersection point of the angle bisector from the
opposite point of 'side' with the side 'side'.</documentation></function></asyxml>*/
@@ -6129,20 +6150,20 @@ point bisectorpoint(side side)
return trilinear(t, 1, 0, 1);
}
-/*<asyxml><function type = "line" signature = "bisector(vertex, real)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="bisector(vertex,real)"><code></asyxml>*/
line bisector(vertex V, real angle = 0)
{/*<asyxml></code><documentation>Return the interior bisector passing through 'V' rotated by angle (in degrees)
around 'V'.</documentation></function></asyxml>*/
return rotate(angle, point(V)) * line(point(V), incenter(V.t));
}
-/*<asyxml><function type = "line" signature = "bisector(side)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="bisector(side)"><code></asyxml>*/
line bisector(side side)
{/*<asyxml></code><documentation>Return the bisector of the line segment 'side'.</documentation></function></asyxml>*/
return bisector(segment(side));
}
-/*<asyxml><function type = "point" signature = "intouch(side)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="intouch(side)"><code></asyxml>*/
point intouch(side side)
{/*<asyxml></code><documentation>The point of tangency on the side 'side' of its incircle.</documentation></function></asyxml>*/
triangle t = side.t;
@@ -6153,7 +6174,7 @@ point intouch(side side)
return trilinear(t, b * c/(-a + b + c), 0, a * b/(a + b - c));
}
-/*<asyxml><function type = "triangle" signature = "intouch(triangle)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="intouch(triangle)"><code></asyxml>*/
triangle intouch(triangle t)
{/*<asyxml></code><documentation>Return the intouch triangle of the triangle 't'.
The intouch triangle of 't' is the triangle formed by the points
@@ -6166,7 +6187,7 @@ triangle intouch(triangle t)
return triangle(A, B, C);
}
-/*<asyxml><function type = "triangle" signature = "tangential(triangle)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="tangential(triangle)"><code></asyxml>*/
triangle tangential(triangle t)
{/*<asyxml></code><documentation>Return the tangential triangle of the triangle 't'.
The tangential triangle of 't' is the triangle formed by the lines
@@ -6179,31 +6200,31 @@ triangle tangential(triangle t)
return triangle(A, B, C);
}
-/*<asyxml><function type = "triangle" signature = "medial(triangle t)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="medial(triangle t)"><code></asyxml>*/
triangle medial(triangle t)
{/*<asyxml></code><documentation>Return the triangle whose vertices are midpoints of the sides of 't'.</documentation></function></asyxml>*/
return triangle(midpoint(t.BC), midpoint(t.AC), midpoint(t.AB));
}
-/*<asyxml><function type = "line" signature = "median(vertex)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="median(vertex)"><code></asyxml>*/
line median(vertex V)
{/*<asyxml></code><documentation>Return median from 'V'.</documentation></function></asyxml>*/
return line(point(V), midpoint(segment(opposite(V))));
}
-/*<asyxml><function type = "line" signature = "median(side)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="median(side)"><code></asyxml>*/
line median(side side)
{/*<asyxml></code><documentation>Return median from the opposite vertex of 'side'.</documentation></function></asyxml>*/
return median(opposite(side));
}
-/*<asyxml><function type = "triangle" signature = "orthic(triangle)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="orthic(triangle)"><code></asyxml>*/
triangle orthic(triangle t)
{/*<asyxml></code><documentation>Return the triangle whose vertices are endpoints of the altitudes from each of the vertices of 't'.</documentation></function></asyxml>*/
return triangle(foot(t.BC), foot(t.AC), foot(t.AB));
}
-/*<asyxml><function type = "triangle" signature = "symmedial(triangle)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="symmedial(triangle)"><code></asyxml>*/
triangle symmedial(triangle t)
{/*<asyxml></code><documentation>Return the symmedial triangle of 't'.</documentation></function></asyxml>*/
point A, B, C;
@@ -6214,7 +6235,7 @@ triangle symmedial(triangle t)
return triangle(A, B, C);
}
-/*<asyxml><function type = "triangle" signature = "anticomplementary(triangle)"><code></asyxml>*/
+/*<asyxml><function type="triangle" signature="anticomplementary(triangle)"><code></asyxml>*/
triangle anticomplementary(triangle t)
{/*<asyxml></code><documentation>Return the triangle which has the given triangle 't' as its medial triangle.</documentation></function></asyxml>*/
real a = t.a(), b = t.b(), c = t.c();
@@ -6225,7 +6246,7 @@ triangle anticomplementary(triangle t)
return triangle(A, B, C);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(triangle, line, bool)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(triangle,line,bool)"><code></asyxml>*/
point[] intersectionpoints(triangle t, line l, bool extended = false)
{/*<asyxml></code><documentation>Return the intersection points.
If 'extended' is true, the sides are lines else the sides are segments.
@@ -6258,7 +6279,7 @@ point[] intersectionpoints(line l, triangle t, bool extended = false)
return intersectionpoints(t, l, extended);
}
-/*<asyxml><function type = "vector" signature = "dir(vertex)"><code></asyxml>*/
+/*<asyxml><function type="vector" signature="dir(vertex)"><code></asyxml>*/
vector dir(vertex V)
{/*<asyxml></code><documentation>The direction (towards the outside of the triangle) of the interior angle bisector of 'V'.</documentation></function></asyxml>*/
triangle t = V.t;
@@ -6267,7 +6288,7 @@ vector dir(vertex V)
return vector(defaultcoordsys, (-dir(t.C--t.A, t.C--t.B)));
}
-/*<asyxml><function type = "void" signature = "lvoid label(picture, Label, vertex, pair, real, pen, filltype)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="lvoid label(picture,Label,vertex,pair,real,pen,filltype)"><code></asyxml>*/
void label(picture pic = currentpicture, Label L, vertex V,
pair align = dir(V),
real alignFactor = 1,
@@ -6276,7 +6297,7 @@ void label(picture pic = currentpicture, Label L, vertex V,
label(pic, L, locate(point(V)), alignFactor * align, p, filltype);
}
-/*<asyxml><function type = "void" signature = "label(picture, Label, Label, Label, triangle, real, real, pen, filltype)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="label(picture,Label,Label,Label,triangle,real,real,pen,filltype)"><code></asyxml>*/
void label(picture pic = currentpicture, Label LA = "$A$",
Label LB = "$B$", Label LC = "$C$",
triangle t,
@@ -6297,7 +6318,7 @@ void label(picture pic = currentpicture, Label LA = "$A$",
label(pic, llc, t.VC, align = llc.align.dir, alignFactor = alignFactor, p, filltype);
}
-/*<asyxml><function type = "void" signature = "show(picture, Label, Label, Label, Label, Label, Label, triangle, pen, filltype)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="show(picture,Label,Label,Label,Label,Label,Label,triangle,pen,filltype)"><code></asyxml>*/
void show(picture pic = currentpicture,
Label LA = "$A$", Label LB = "$B$", Label LC = "$C$",
Label La = "$a$", Label Lb = "$b$", Label Lc = "$c$",
@@ -6310,24 +6331,24 @@ void show(picture pic = currentpicture,
label(pic, LC, c, -dir(c--a, c--b), p, filltype);
pair aligna = I * unit(c - b), alignb = I * unit(c - a), alignc = I * unit(b - a);
pair mAB = locate(midpoint(t.AB)), mAC = locate(midpoint(t.AC)), mBC = locate(midpoint(t.BC));
- draw(pic, La, b--c, align = rotate(dot(a - mBC, aligna) > 0 ? 180 :0) * aligna, p);
- draw(pic, Lb, a--c, align = rotate(dot(b - mAC, alignb) > 0 ? 180 :0) * alignb, p);
- draw(pic, Lc, a--b, align = rotate(dot(c - mAB, alignc) > 0 ? 180 :0) * alignc, p);
+ label(pic, La, b--c, align = rotate(dot(a - mBC, aligna) > 0 ? 180 :0) * aligna, p);
+ label(pic, Lb, a--c, align = rotate(dot(b - mAC, alignb) > 0 ? 180 :0) * alignb, p);
+ label(pic, Lc, a--b, align = rotate(dot(c - mAB, alignc) > 0 ? 180 :0) * alignc, p);
}
-/*<asyxml><function type = "void" signature = "draw(picture, triangle, pen, marker)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="draw(picture,triangle,pen,marker)"><code></asyxml>*/
void draw(picture pic = currentpicture, triangle t, pen p = currentpen, marker marker = nomarker)
{/*<asyxml></code><documentation>Draw sides of the triangle 't' on picture 'pic' using pen 'p'.</documentation></function></asyxml>*/
draw(pic, t.Path(), p, marker);
}
-/*<asyxml><function type = "void" signature = "draw(picture, triangle[], pen, marker)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="draw(picture,triangle[],pen,marker)"><code></asyxml>*/
void draw(picture pic = currentpicture, triangle[] t, pen p = currentpen, marker marker = nomarker)
{/*<asyxml></code><documentation>Draw sides of the triangles 't' on picture 'pic' using pen 'p'.</documentation></function></asyxml>*/
for(int i = 0; i < t.length; ++i) draw(pic, t[i], p, marker);
}
-/*<asyxml><function type = "void" signature = "drawline(picture, triangle, pen)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="drawline(picture,triangle,pen)"><code></asyxml>*/
void drawline(picture pic = currentpicture, triangle t, pen p = currentpen)
{/*<asyxml></code><documentation>Draw lines of the triangle 't' on picture 'pic' using pen 'p'.</documentation></function></asyxml>*/
draw(t, p);
@@ -6336,7 +6357,7 @@ void drawline(picture pic = currentpicture, triangle t, pen p = currentpen)
draw(pic, line(t.B, t.C), p);
}
-/*<asyxml><function type = "void" signature = "dot(picture, triangle, pen)"><code></asyxml>*/
+/*<asyxml><function type="void" signature="dot(picture,triangle,pen)"><code></asyxml>*/
void dot(picture pic = currentpicture, triangle t, pen p = currentpen)
{/*<asyxml></code><documentation>Draw a dot at each vertex of 't'.</documentation></function></asyxml>*/
dot(pic, t.A^^t.B^^t.C, p);
@@ -6346,13 +6367,13 @@ void dot(picture pic = currentpicture, triangle t, pen p = currentpen)
// *=======================================================*
// *.......................INVERSIONS......................*
-/*<asyxml><function type = "point" signature = "inverse(real k, point, point)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="inverse(real k,point,point)"><code></asyxml>*/
point inverse(real k, point A, point M)
{/*<asyxml></code><documentation>Return the inverse point of 'M' with respect to point A and inversion radius 'k'.</documentation></function></asyxml>*/
return A + k/conj(M - A);
}
-/*<asyxml><function type = "point" signature = "radicalcenter(circle, circle)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="radicalcenter(circle,circle)"><code></asyxml>*/
point radicalcenter(circle c1, circle c2)
{/*<asyxml></code><documentation><url href = "http://fr.wikipedia.org/wiki/Puissance_d'un_point_par_rapport_%C3%A0_un_cercle"/></documentation></function></asyxml>*/
point[] P = standardizecoordsys(c1.C, c2.C);
@@ -6366,27 +6387,27 @@ point radicalcenter(circle c1, circle c2)
return point(P[0].coordsys, K/P[0].coordsys);
}
-/*<asyxml><function type = "line" signature = "radicalline(circle, circle)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="radicalline(circle,circle)"><code></asyxml>*/
line radicalline(circle c1, circle c2)
{/*<asyxml></code><documentation><url href = "http://fr.wikipedia.org/wiki/Puissance_d'un_point_par_rapport_%C3%A0_un_cercle"/></documentation></function></asyxml>*/
if (c1.C == c2.C) abort("radicalline: the centers must be distinct");
return perpendicular(radicalcenter(c1, c2), line(c1.C, c2.C));
}
-/*<asyxml><function type = "point" signature = "radicalcenter(circle, circle, circle)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="radicalcenter(circle,circle,circle)"><code></asyxml>*/
point radicalcenter(circle c1, circle c2, circle c3)
{/*<asyxml></code><documentation><url href = "http://fr.wikipedia.org/wiki/Puissance_d'un_point_par_rapport_%C3%A0_un_cercle"/></documentation></function></asyxml>*/
return intersectionpoint(radicalline(c1, c2), radicalline(c1, c3));
}
-/*<asyxml><struct signature = "inversion"><code></asyxml>*/
+/*<asyxml><struct signature="inversion"><code></asyxml>*/
struct inversion
{/*<asyxml></code><documentation>http://mathworld.wolfram.com/Inversion.html</documentation></asyxml>*/
point C;
real k;
}/*<asyxml></struct></asyxml>*/
-/*<asyxml><function type = "inversion" signature = "inversion(real, point)"><code></asyxml>*/
+/*<asyxml><function type="inversion" signature="inversion(real,point)"><code></asyxml>*/
inversion inversion(real k, point C)
{/*<asyxml></code><documentation>Return the inversion with respect to 'C' having inversion radius 'k'.</documentation></function></asyxml>*/
inversion oi;
@@ -6394,13 +6415,13 @@ inversion inversion(real k, point C)
oi.C = C;
return oi;
}
-/*<asyxml><function type = "inversion" signature = "inversion(real, point)"><code></asyxml>*/
+/*<asyxml><function type="inversion" signature="inversion(real,point)"><code></asyxml>*/
inversion inversion(point C, real k)
{/*<asyxml></code><documentation>Return the inversion with respect to 'C' having inversion radius 'k'.</documentation></function></asyxml>*/
return inversion(k, C);
}
-/*<asyxml><function type = "inversion" signature = "inversion(circle, circle)"><code></asyxml>*/
+/*<asyxml><function type="inversion" signature="inversion(circle,circle)"><code></asyxml>*/
inversion inversion(circle c1, circle c2, real sgn = 1)
{/*<asyxml></code><documentation>Return the inversion which transforms 'c1' to
. 'c2' and positive inversion radius if 'sgn > 0';
@@ -6419,7 +6440,7 @@ inversion inversion(circle c1, circle c2, real sgn = 1)
return inversion(-a * abs(abs(O - c2.C)^2 - c2.r^2), O);
}
-/*<asyxml><function type = "inversion" signature = "inversion(circle, circle, circle)"><code></asyxml>*/
+/*<asyxml><function type="inversion" signature="inversion(circle,circle,circle)"><code></asyxml>*/
inversion inversion(circle c1, circle c2, circle c3)
{/*<asyxml></code><documentation>Return the inversion which transform 'c1' to 'c1', 'c2' to 'c2' and 'c3' to 'c3'.</documentation></function></asyxml>*/
point Rc = radicalcenter(c1, c2, c3);
@@ -6427,7 +6448,7 @@ inversion inversion(circle c1, circle c2, circle c3)
}
circle operator cast(inversion i){return circle(i.C, sgn(i.k) * sqrt(abs(i.k)));}
-/*<asyxml><function type = "circle" signature = "circle(inversion)"><code></asyxml>*/
+/*<asyxml><function type="circle" signature="circle(inversion)"><code></asyxml>*/
circle circle(inversion i)
{/*<asyxml></code><documentation>Return the inversion circle of 'i'.</documentation></function></asyxml>*/
return i;
@@ -6437,13 +6458,13 @@ inversion operator cast(circle c)
{
return inversion(sgn(c.r) * c.r^2, c.C);
}
-/*<asyxml><function type = "inversion" signature = "inversion(circle)"><code></asyxml>*/
+/*<asyxml><function type="inversion" signature="inversion(circle)"><code></asyxml>*/
inversion inversion(circle c)
{/*<asyxml></code><documentation>Return the inversion represented by the circle of 'c'.</documentation></function></asyxml>*/
return c;
}
-/*<asyxml><operator type = "point" signature = "*(inversion, point)"><code></asyxml>*/
+/*<asyxml><operator type = "point" signature="*(inversion,point)"><code></asyxml>*/
point operator *(inversion i, point P)
{/*<asyxml></code><documentation>Provide inversion * point.</documentation></operator></asyxml>*/
return inverse(i.k, i.C, P);
@@ -6456,7 +6477,7 @@ The returned circle has an infinite radius, circle.l has been set.");
}
-/*<asyxml><function type = "circle" signature = "inverse(real, point, line)"><code></asyxml>*/
+/*<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>*/
@@ -6470,13 +6491,13 @@ circle inverse(real k, point A, line l)
return circle(A, Ap, Bp);
}
-/*<asyxml><operator type = "circle" signature = "*(inversion, line)"><code></asyxml>*/
+/*<asyxml><operator type = "circle" signature="*(inversion,line)"><code></asyxml>*/
circle operator *(inversion i, line l)
{/*<asyxml></code><documentation>Provide inversion * line for lines that don't pass through the inversion center.</documentation></operator></asyxml>*/
return inverse(i.k, i.C, l);
}
-/*<asyxml><function type = "circle" signature = "inverse(real, point, circle)"><code></asyxml>*/
+/*<asyxml><function type="circle" signature="inverse(real,point,circle)"><code></asyxml>*/
circle inverse(real k, point A, circle c)
{/*<asyxml></code><documentation>Return the inverse circle of 'c' with
respect to point A and inversion radius 'k'.</documentation></function></asyxml>*/
@@ -6493,7 +6514,7 @@ circle inverse(real k, point A, circle c)
return circle(P[0] + s * (P[1]-P[0]), abs(s) * c.r);
}
-/*<asyxml><operator type = "circle" signature = "*(inversion, circle)"><code></asyxml>*/
+/*<asyxml><operator type = "circle" signature="*(inversion,circle)"><code></asyxml>*/
circle operator *(inversion i, circle c)
{/*<asyxml></code><documentation>Provide inversion * circle.</documentation></operator></asyxml>*/
return inverse(i.k, i.C, c);
@@ -6503,7 +6524,7 @@ circle operator *(inversion i, circle c)
// *=======================================================*
// *........................FOOTER.........................*
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(line, circle)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(line,circle)"><code></asyxml>*/
point[] intersectionpoints(line l, circle c)
{/*<asyxml></code><documentation>Note that the line 'l' may be a segment by casting.
intersectionpoints(circle, line) is also defined.</documentation></function></asyxml>*/
@@ -6534,7 +6555,7 @@ point[] intersectionpoints(circle c, line l)
return intersectionpoints(l, c);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(line, ellipse)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(line,ellipse)"><code></asyxml>*/
point[] intersectionpoints(line l, ellipse el)
{/*<asyxml></code><documentation>Note that the line 'l' may be a segment by casting.
intersectionpoints(ellipse, line) is also defined.</documentation></function></asyxml>*/
@@ -6574,7 +6595,7 @@ point[] intersectionpoints(ellipse el, line l)
return intersectionpoints(l, el);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(line, parabola)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(line,parabola)"><code></asyxml>*/
point[] intersectionpoints(line l, parabola p)
{/*<asyxml></code><documentation>Note that the line 'l' may be a segment by casting.
intersectionpoints(parabola, line) is also defined.</documentation></function></asyxml>*/
@@ -6610,7 +6631,7 @@ point[] intersectionpoints(parabola p, line l)
return intersectionpoints(l, p);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(line, hyperbola)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(line,hyperbola)"><code></asyxml>*/
point[] intersectionpoints(line l, hyperbola h)
{/*<asyxml></code><documentation>Note that the line 'l' may be a segment by casting.
intersectionpoints(hyperbola, line) is also defined.</documentation></function></asyxml>*/
@@ -6638,7 +6659,7 @@ point[] intersectionpoints(hyperbola h, line l)
return intersectionpoints(l, h);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(line, conic)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(line,conic)"><code></asyxml>*/
point[] intersectionpoints(line l, conic co)
{/*<asyxml></code><documentation>Note that the line 'l' may be a segment by casting.
intersectionpoints(conic, line) is also defined.</documentation></function></asyxml>*/
@@ -6655,7 +6676,7 @@ point[] intersectionpoints(conic co, line l)
return intersectionpoints(l, co);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(conic, conic)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(conic,conic)"><code></asyxml>*/
point[] intersectionpoints(conic co1, conic co2)
{/*<asyxml></code><documentation>Return the intersection points of the two conics.</documentation></function></asyxml>*/
if(degenerate(co1)) return intersectionpoints(co1.l[0], co2);
@@ -6663,7 +6684,7 @@ point[] intersectionpoints(conic co1, conic co2)
return intersectionpoints(equation(co1), equation(co2));
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(triangle, conic, bool)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(triangle,conic,bool)"><code></asyxml>*/
point[] intersectionpoints(triangle t, conic co, bool extended = false)
{/*<asyxml></code><documentation>Return the intersection points.
If 'extended' is true, the sides are lines else the sides are segments.
@@ -6697,91 +6718,91 @@ point[] intersectionpoints(conic co, triangle t, bool extended = false)
return intersectionpoints(t, co, extended);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(ellipse, ellipse)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(ellipse,ellipse)"><code></asyxml>*/
point[] intersectionpoints(ellipse a, ellipse b)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
// if(degenerate(a)) return intersectionpoints(a.l, b);
// if(degenerate(b)) return intersectionpoints(a, b.l);;
return intersectionpoints((conic)a, (conic)b);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(ellipse, circle)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(ellipse,circle)"><code></asyxml>*/
point[] intersectionpoints(ellipse a, circle b)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
// if(degenerate(a)) return intersectionpoints(a.l, b);
// if(degenerate(b)) return intersectionpoints(a, b.l);;
return intersectionpoints((conic)a, (conic)b);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(circle, ellipse)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(circle,ellipse)"><code></asyxml>*/
point[] intersectionpoints(circle a, ellipse b)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
return intersectionpoints(b, a);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(ellipse, parabola)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(ellipse,parabola)"><code></asyxml>*/
point[] intersectionpoints(ellipse a, parabola b)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
// if(degenerate(a)) return intersectionpoints(a.l, b);
return intersectionpoints((conic)a, (conic)b);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(parabola, ellipse)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(parabola,ellipse)"><code></asyxml>*/
point[] intersectionpoints(parabola a, ellipse b)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
return intersectionpoints(b, a);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(ellipse, hyperbola)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(ellipse,hyperbola)"><code></asyxml>*/
point[] intersectionpoints(ellipse a, hyperbola b)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
// if(degenerate(a)) return intersectionpoints(a.l, b);
return intersectionpoints((conic)a, (conic)b);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(hyperbola, ellipse)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(hyperbola,ellipse)"><code></asyxml>*/
point[] intersectionpoints(hyperbola a, ellipse b)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
return intersectionpoints(b, a);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(circle, parabola)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(circle,parabola)"><code></asyxml>*/
point[] intersectionpoints(circle a, parabola b)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
return intersectionpoints((conic)a, (conic)b);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(parabola, circle)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(parabola,circle)"><code></asyxml>*/
point[] intersectionpoints(parabola a, circle b)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
return intersectionpoints((conic)a, (conic)b);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(circle, hyperbola)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(circle,hyperbola)"><code></asyxml>*/
point[] intersectionpoints(circle a, hyperbola b)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
return intersectionpoints((conic)a, (conic)b);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(hyperbola, circle)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(hyperbola,circle)"><code></asyxml>*/
point[] intersectionpoints(hyperbola a, circle b)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
return intersectionpoints((conic)a, (conic)b);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(parabola, parabola)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(parabola,parabola)"><code></asyxml>*/
point[] intersectionpoints(parabola a, parabola b)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
return intersectionpoints((conic)a, (conic)b);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(parabola, hyperbola)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(parabola,hyperbola)"><code></asyxml>*/
point[] intersectionpoints(parabola a, hyperbola b)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
return intersectionpoints((conic)a, (conic)b);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(hyperbola, parabola)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(hyperbola,parabola)"><code></asyxml>*/
point[] intersectionpoints(hyperbola a, parabola b)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
return intersectionpoints((conic)a, (conic)b);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(hyperbola, hyperbola)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(hyperbola,hyperbola)"><code></asyxml>*/
point[] intersectionpoints(hyperbola a, hyperbola b)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
return intersectionpoints((conic)a, (conic)b);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(circle, circle)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(circle,circle)"><code></asyxml>*/
point[] intersectionpoints(circle c1, circle c2)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
if(degenerate(c1))
@@ -6793,7 +6814,7 @@ point[] intersectionpoints(circle c1, circle c2)
intersectionpoints(radicalline(c1, c2), c1);
}
-/*<asyxml><function type = "line" signature = "tangent(circle, abscissa)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="tangent(circle,abscissa)"><code></asyxml>*/
line tangent(circle c, abscissa x)
{/*<asyxml></code><documentation>Return the tangent of 'c' at 'point(c, x)'.</documentation></function></asyxml>*/
if(c.r == 0) abort("tangent: a circle with a radius equals zero has no tangent.");
@@ -6801,7 +6822,7 @@ line tangent(circle c, abscissa x)
return line(rotate(90, M) * c.C, M);
}
-/*<asyxml><function type = "line[]" signature = "tangents(circle, point)"><code></asyxml>*/
+/*<asyxml><function type="line[]" signature="tangents(circle,point)"><code></asyxml>*/
line[] tangents(circle c, point M)
{/*<asyxml></code><documentation>Return the tangents of 'c' passing through 'M'.</documentation></function></asyxml>*/
line[] ol;
@@ -6817,28 +6838,28 @@ line[] tangents(circle c, point M)
return ol;
}
-/*<asyxml><function type = "point" signature = "point(circle, point)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(circle,point)"><code></asyxml>*/
point point(circle c, point M)
{/*<asyxml></code><documentation>Return the intersection point of 'c'
with the half-line '[c.C M)'.</documentation></function></asyxml>*/
return intersectionpoints(c, line(c.C, false, M))[0];
}
-/*<asyxml><function type = "line" signature = "tangent(circle, point)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="tangent(circle,point)"><code></asyxml>*/
line tangent(circle c, point M)
{/*<asyxml></code><documentation>Return the tangent of 'c' at the
intersection point of the half-line'[c.C M)'.</documentation></function></asyxml>*/
return tangents(c, point(c, M))[0];
}
-/*<asyxml><function type = "point" signature = "point(circle, explicit vector)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="point(circle,explicit vector)"><code></asyxml>*/
point point(circle c, explicit vector v)
{/*<asyxml></code><documentation>Return the intersection point of 'c'
with the half-line '[c.C v)'.</documentation></function></asyxml>*/
return point(c, c.C + v);
}
-/*<asyxml><function type = "line" signature = "tangent(circle, explicit vector)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="tangent(circle,explicit vector)"><code></asyxml>*/
line tangent(circle c, explicit vector v)
{/*<asyxml></code><documentation>Return the tangent of 'c' at the
point M so that vec(c.C M) is collinear to 'v' with the same sense.</documentation></function></asyxml>*/
@@ -6846,7 +6867,7 @@ line tangent(circle c, explicit vector v)
return dot(ol.v, v) > 0 ? ol : reverse(ol);
}
-/*<asyxml><function type = "line" signature = "tangent(ellipse, abscissa)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="tangent(ellipse,abscissa)"><code></asyxml>*/
line tangent(ellipse el, abscissa x)
{/*<asyxml></code><documentation>Return the tangent of 'el' at 'point(el, x)'.</documentation></function></asyxml>*/
point M = point(el, x);
@@ -6856,7 +6877,7 @@ line tangent(ellipse el, abscissa x)
return ol;
}
-/*<asyxml><function type = "line[]" signature = "tangents(ellipse, point)"><code></asyxml>*/
+/*<asyxml><function type="line[]" signature="tangents(ellipse,point)"><code></asyxml>*/
line[] tangents(ellipse el, point M)
{/*<asyxml></code><documentation>Return the tangents of 'el' passing through 'M'.</documentation></function></asyxml>*/
line[] ol;
@@ -6878,7 +6899,7 @@ line[] tangents(ellipse el, point M)
return ol;
}
-/*<asyxml><function type = "line" signature = "tangent(parabola, abscissa)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="tangent(parabola,abscissa)"><code></asyxml>*/
line tangent(parabola p, abscissa x)
{/*<asyxml></code><documentation>Return the tangent of 'p' at 'point(p, x)' (use the Wells method).</documentation></function></asyxml>*/
line lt = rotate(90, p.V) * line(p.V, p.F);
@@ -6889,7 +6910,7 @@ line tangent(parabola p, abscissa x)
return line(P, projection(lt) * M);
}
-/*<asyxml><function type = "line[]" signature = "tangents(parabola, point)"><code></asyxml>*/
+/*<asyxml><function type="line[]" signature="tangents(parabola,point)"><code></asyxml>*/
line[] tangents(parabola p, point M)
{/*<asyxml></code><documentation>Return the tangent of 'p' at 'M' (use the Wells method).</documentation></function></asyxml>*/
line[] ol;
@@ -6914,7 +6935,7 @@ line[] tangents(parabola p, point M)
return ol;
}
-/*<asyxml><function type = "line" signature = "tangent(hyperbola, abscissa)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="tangent(hyperbola,abscissa)"><code></asyxml>*/
line tangent(hyperbola h, abscissa x)
{/*<asyxml></code><documentation>Return the tangent of 'h' at 'point(p, x)'.</documentation></function></asyxml>*/
point M = point(h, x);
@@ -6923,7 +6944,7 @@ line tangent(hyperbola h, abscissa x)
return ol;
}
-/*<asyxml><function type = "line[]" signature = "tangents(hyperbola, point)"><code></asyxml>*/
+/*<asyxml><function type="line[]" signature="tangents(hyperbola,point)"><code></asyxml>*/
line[] tangents(hyperbola h, point M)
{/*<asyxml></code><documentation>Return the tangent of 'h' at 'M'.</documentation></function></asyxml>*/
line[] ol;
@@ -6951,7 +6972,7 @@ line[] tangents(hyperbola h, point M)
return ol;
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(conic, arc)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(conic,arc)"><code></asyxml>*/
point[] intersectionpoints(conic co, arc a)
{/*<asyxml></code><documentation>intersectionpoints(arc, circle) is also defined.</documentation></function></asyxml>*/
point[] op;
@@ -6966,7 +6987,7 @@ point[] intersectionpoints(arc a, conic co)
return intersectionpoints(co, a);
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(arc, arc)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(arc,arc)"><code></asyxml>*/
point[] intersectionpoints(arc a1, arc a2)
{/*<asyxml></code><documentation></documentation></function></asyxml>*/
point[] op;
@@ -6977,7 +6998,7 @@ point[] intersectionpoints(arc a1, arc a2)
}
-/*<asyxml><function type = "point[]" signature = "intersectionpoints(line, arc)"><code></asyxml>*/
+/*<asyxml><function type="point[]" signature="intersectionpoints(line,arc)"><code></asyxml>*/
point[] intersectionpoints(line l, arc a)
{/*<asyxml></code><documentation>intersectionpoints(arc, line) is also defined.</documentation></function></asyxml>*/
point[] op;
@@ -6992,7 +7013,7 @@ point[] intersectionpoints(arc a, line l)
return intersectionpoints(l, a);
}
-/*<asyxml><function type = "point" signature = "arcsubtendedcenter(point, point, real)"><code></asyxml>*/
+/*<asyxml><function type="point" signature="arcsubtendedcenter(point,point,real)"><code></asyxml>*/
point arcsubtendedcenter(point A, point B, real angle)
{/*<asyxml></code><documentation>Return the center of the arc retuned
by the 'arcsubtended' routine.</documentation></function></asyxml>*/
@@ -7004,7 +7025,7 @@ point arcsubtendedcenter(point A, point B, real angle)
return intersectionpoint(bis, rotate(90 - angle, A) * AB);
}
-/*<asyxml><function type = "arc" signature = "arcsubtended(point, point, real)"><code></asyxml>*/
+/*<asyxml><function type="arc" signature="arcsubtended(point,point,real)"><code></asyxml>*/
arc arcsubtended(point A, point B, real angle)
{/*<asyxml></code><documentation>Return the arc circle from which the segment AB is saw with
the angle 'angle'.
@@ -7019,18 +7040,24 @@ arc arcsubtended(point A, point B, real angle)
return arc(circle(C, abs(B - C)), BC, AC, angle > 0 ? CCW : CW);
}
-/*<asyxml><function type = "arc" signature = "arccircle(point, point, point)"><code></asyxml>*/
+/*<asyxml><function type="arc" signature="arccircle(point,point,point)"><code></asyxml>*/
arc arccircle(point A, point M, point B)
{/*<asyxml></code><documentation>Return the CCW arc circle 'AB' passing through 'M'.</documentation></function></asyxml>*/
circle tc = circle(A, M, B);
real a = degrees(A - tc.C);
real b = degrees(B - tc.C);
+ real m = degrees(M - tc.C);
+
arc oa = arc(tc, a, b);
- if(!(M @ oa)) oa.direction=!oa.direction;
+ // TODO : use cross product to determine CWW or CW
+ if (!(M @ oa)) {
+ oa.direction = !oa.direction;
+ }
+
return oa;
}
-/*<asyxml><function type = "arc" signature = "arc(ellipse, abscissa, abscissa, bool)"><code></asyxml>*/
+/*<asyxml><function type="arc" signature="arc(ellipse,abscissa,abscissa,bool)"><code></asyxml>*/
arc arc(ellipse el, explicit abscissa x1, explicit abscissa x2, bool direction = CCW)
{/*<asyxml></code><documentation>Return the arc from 'point(c, x1)' to 'point(c, x2)' in the direction 'direction'.</documentation></function></asyxml>*/
real a = degrees(point(el, x1) - el.C);
@@ -7039,14 +7066,14 @@ arc arc(ellipse el, explicit abscissa x1, explicit abscissa x2, bool direction =
return oa;
}
-/*<asyxml><function type = "arc" signature = "arc(ellipse, point, point, bool)"><code></asyxml>*/
+/*<asyxml><function type="arc" signature="arc(ellipse,point,point,bool)"><code></asyxml>*/
arc arc(ellipse el, point M, point N, bool direction = CCW)
{/*<asyxml></code><documentation>Return the arc from 'M' to 'N' in the direction 'direction'.
The points 'M' and 'N' must belong to the ellipse 'el'.</documentation></function></asyxml>*/
return arc(el, relabscissa(el, M), relabscissa(el, N), direction);
}
-/*<asyxml><function type = "arc" signature = "arccircle(point, point, real, bool)"><code></asyxml>*/
+/*<asyxml><function type="arc" signature="arccircle(point,point,real,bool)"><code></asyxml>*/
arc arccircle(point A, point B, real angle, bool direction = CCW)
{/*<asyxml></code><documentation>Return the arc circle centered on A
from B to rotate(angle, A) * B in the direction 'direction'.</documentation></function></asyxml>*/
@@ -7054,8 +7081,7 @@ arc arccircle(point A, point B, real angle, bool direction = CCW)
return arc(circle(A, abs(A - B)), B, M, direction);
}
-
-/*<asyxml><function type = "arc" signature = "arc(explicit arc, abscissa, abscissa)"><code></asyxml>*/
+/*<asyxml><function type="arc" signature="arc(explicit arc,abscissa,abscissa)"><code></asyxml>*/
arc arc(explicit arc a, abscissa x1, abscissa x2)
{/*<asyxml></code><documentation>Return the arc from 'point(a, x1)' to 'point(a, x2)' traversed in the direction of the arc direction.</documentation></function></asyxml>*/
real a1 = angabscissa(a.el, point(a, x1), a.polarconicroutine).x;
@@ -7063,14 +7089,14 @@ arc arc(explicit arc a, abscissa x1, abscissa x2)
return arc(a.el, a1, a2, a.polarconicroutine, a.direction);
}
-/*<asyxml><function type = "arc" signature = "arc(explicit arc, point, point)"><code></asyxml>*/
+/*<asyxml><function type="arc" signature="arc(explicit arc,point,point)"><code></asyxml>*/
arc arc(explicit arc a, point M, point N)
{/*<asyxml></code><documentation>Return the arc from 'M' to 'N'.
The points 'M' and 'N' must belong to the arc 'a'.</documentation></function></asyxml>*/
return arc(a, relabscissa(a, M), relabscissa(a, N));
}
-/*<asyxml><function type = "arc" signature = "inverse(real, point, segment)"><code></asyxml>*/
+/*<asyxml><function type="arc" signature="inverse(real,point,segment)"><code></asyxml>*/
arc inverse(real k, point A, segment s)
{/*<asyxml></code><documentation>Return the inverse arc circle of 's'
with respect to point A and inversion radius 'k'.</documentation></function></asyxml>*/
@@ -7079,22 +7105,22 @@ arc inverse(real k, point A, segment s)
return arccircle(Ap, M, Bp);
}
-/*<asyxml><operator type = "arc" signature = "*(inversion, segment)"><code></asyxml>*/
+/*<asyxml><operator type = "arc" signature="*(inversion,segment)"><code></asyxml>*/
arc operator *(inversion i, segment s)
{/*<asyxml></code><documentation>Provide
inversion * segment.</documentation></operator></asyxml>*/
return inverse(i.k, i.C, s);
}
-/*<asyxml><operator type = "path" signature = "*(inversion, triangle)"><code></asyxml>*/
+/*<asyxml><operator type = "path" signature="*(inversion,triangle)"><code></asyxml>*/
path operator *(inversion i, triangle t)
{/*<asyxml></code><documentation>Provide inversion * triangle.</documentation></operator></asyxml>*/
return (path)(i * segment(t.AB))--
(path)(i * segment(t.BC))--
- (path)(i * segment(t.CA))--cycle;
+ (path)(i * segment(t.CA))&cycle;
}
-/*<asyxml><function type = "path" signature = "compassmark(pair, pair, real, real)"><code></asyxml>*/
+/*<asyxml><function type="path" signature="compassmark(pair,pair,real,real)"><code></asyxml>*/
path compassmark(pair O, pair A, real position, real angle = 10)
{/*<asyxml></code><documentation>Return an arc centered on O with the angle 'angle' so that the position
of 'A' on this arc makes an angle 'position * angle'.</documentation></function></asyxml>*/
@@ -7108,14 +7134,14 @@ path compassmark(pair O, pair A, real position, real angle = 10)
return shift(O) * scale(abs(O - A)) * subpath(unitcircle, t1, t2);
}
-/*<asyxml><function type = "line" signature = "tangent(explicit arc, abscissa)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="tangent(explicit arc,abscissa)"><code></asyxml>*/
line tangent(explicit arc a, abscissa x)
{/*<asyxml></code><documentation>Return the tangent of 'a' at 'point(a, x)'.</documentation></function></asyxml>*/
abscissa ag = angabscissa(a, point(a, x));
return tangent(a.el, ag + a.angle1 + (a.el.e == 0 ? a.angle0 : 0));
}
-/*<asyxml><function type = "line" signature = "tangent(explicit arc, point)"><code></asyxml>*/
+/*<asyxml><function type="line" signature="tangent(explicit arc,point)"><code></asyxml>*/
line tangent(explicit arc a, point M)
{/*<asyxml></code><documentation>Return the tangent of 'a' at 'M'.
The points 'M' must belong to the arc 'a'.</documentation></function></asyxml>*/
diff --git a/Master/texmf/asymptote/graph.asy b/Master/texmf/asymptote/graph.asy
index a7ffabc6220..cbcea4aeae3 100644
--- a/Master/texmf/asymptote/graph.asy
+++ b/Master/texmf/asymptote/graph.asy
@@ -593,9 +593,11 @@ tickvalues generateticks(int sign, Label F="", ticklabel ticklabel=null,
if(b-a < 100.0*epsilon*norm) b=a;
- real tickmin=finite(locate.S.tickMin) && (Step == 0 || locate.S.automin) ?
+ bool autotick=Step == 0 && N == 0;
+
+ real tickmin=finite(locate.S.tickMin) && (autotick || locate.S.automin) ?
locate.S.Tinv(locate.S.tickMin) : a;
- real tickmax=finite(locate.S.tickMax) && (Step == 0 || locate.S.automax) ?
+ real tickmax=finite(locate.S.tickMax) && (autotick || locate.S.automax) ?
locate.S.Tinv(locate.S.tickMax) : b;
if(tickmin > tickmax) {real temp=tickmin; tickmin=tickmax; tickmax=temp;}
@@ -603,7 +605,7 @@ tickvalues generateticks(int sign, Label F="", ticklabel ticklabel=null,
bool calcStep=true;
real len=tickmax-tickmin;
- if(Step == 0 && N == 0) {
+ if(autotick) {
N=1;
if(divisor.length > 0) {
bool autoscale=locate.S.automin && locate.S.automax;
@@ -1202,15 +1204,15 @@ void xaxisAt(picture pic=currentpicture, Label L="", axis axis,
});
void bounds() {
- if(type == Min)
+ if(type == Both) {
+ y2=pic.scale.y.automax() ? tickMax(pic).y : pic.userMax().y;
+ y=opposite ? y2 :
+ (pic.scale.y.automin() ? tickMin(pic).y : pic.userMin().y);
+ }
+ else if(type == Min)
y=pic.scale.y.automin() ? tickMin(pic).y : pic.userMin().y;
else if(type == Max)
y=pic.scale.y.automax() ? tickMax(pic).y : pic.userMax().y;
- else if(type == Both) {
- y2=pic.scale.y.automax() ? tickMax(pic).y : pic.userMax().y;
- y=opposite ? y2 :
- (pic.scale.y.automin() ? tickMin(pic).y : pic.userMin().y);
- }
real Xmin=finite(xmin) ? xmin : pic.userMin().x;
real Xmax=finite(xmax) ? xmax : pic.userMax().x;
@@ -1296,15 +1298,14 @@ void yaxisAt(picture pic=currentpicture, Label L="", axis axis,
});
void bounds() {
- if(type == Min)
- x=pic.scale.x.automin() ? tickMin(pic).x : pic.userMin().x;
- else if(type == Max)
- x=pic.scale.x.automax() ? tickMax(pic).x : pic.userMax().x;
- else if(type == Both) {
+ if(type == Both) {
x2=pic.scale.x.automax() ? tickMax(pic).x : pic.userMax().x;
x=opposite ? x2 :
(pic.scale.x.automin() ? tickMin(pic).x : pic.userMin().x);
- }
+ } else if(type == Min)
+ x=pic.scale.x.automin() ? tickMin(pic).x : pic.userMin().x;
+ else if(type == Max)
+ x=pic.scale.x.automax() ? tickMax(pic).x : pic.userMax().x;
real Ymin=finite(ymin) ? ymin : pic.userMin().y;
real Ymax=finite(ymax) ? ymax : pic.userMax().y;
@@ -1655,6 +1656,7 @@ real ScaleY(picture pic=currentpicture, real y)
void tick(picture pic=currentpicture, pair z, pair dir, real size=Ticksize,
pen p=currentpen)
{
+ pair z=Scale(pic,z);
pic.add(new void (frame f, transform t) {
pair tz=t*z;
draw(f,tz--tz+unit(dir)*size,p);
@@ -1666,32 +1668,32 @@ void tick(picture pic=currentpicture, pair z, pair dir, real size=Ticksize,
void xtick(picture pic=currentpicture, explicit pair z, pair dir=N,
real size=Ticksize, pen p=currentpen)
{
- tick(pic,Scale(pic,z),dir,size,p);
+ tick(pic,z,dir,size,p);
}
void xtick(picture pic=currentpicture, real x, pair dir=N,
real size=Ticksize, pen p=currentpen)
{
- xtick(pic,(x,pic.scale.y.scale.logarithmic ? 1 : 0),dir,size,p);
+ tick(pic,(x,pic.scale.y.scale.logarithmic ? 1 : 0),dir,size,p);
}
void ytick(picture pic=currentpicture, explicit pair z, pair dir=E,
real size=Ticksize, pen p=currentpen)
{
- xtick(pic,z,dir,size,p);
+ tick(pic,z,dir,size,p);
}
void ytick(picture pic=currentpicture, real y, pair dir=E,
real size=Ticksize, pen p=currentpen)
{
- xtick(pic,(pic.scale.x.scale.logarithmic ? 1 : 0,y),dir,size,p);
+ tick(pic,(pic.scale.x.scale.logarithmic ? 1 : 0,y),dir,size,p);
}
void tick(picture pic=currentpicture, Label L, real value, explicit pair z,
pair dir, string format="", real size=Ticksize, pen p=currentpen)
{
Label L=L.copy();
- L.position(z);
+ L.position(Scale(pic,z));
L.align(L.align,-dir);
if(shift(L.T)*0 == 0)
L.T=shift(dot(dir,L.align.dir) > 0 ? dir*size :
@@ -1700,7 +1702,7 @@ void tick(picture pic=currentpicture, Label L, real value, explicit pair z,
if(L.s == "") L.s=format(format == "" ? defaultformat : format,value);
L.s=baseline(L.s,baselinetemplate);
add(pic,L);
- xtick(pic,z,dir,size,p);
+ tick(pic,z,dir,size,p);
}
void xtick(picture pic=currentpicture, Label L, explicit pair z, pair dir=N,
@@ -1724,7 +1726,7 @@ void ytick(picture pic=currentpicture, Label L, explicit pair z, pair dir=E,
void ytick(picture pic=currentpicture, Label L, real y, pair dir=E,
string format="", real size=Ticksize, pen p=currentpen)
{
- ytick(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0,y),dir,format,size,p);
+ xtick(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0,y),dir,format,size,p);
}
private void label(picture pic, Label L, pair z, real x, align align,
@@ -1743,13 +1745,13 @@ private void label(picture pic, Label L, pair z, real x, align align,
// Put a label on the x axis.
void labelx(picture pic=currentpicture, Label L="", explicit pair z,
- align align=S, string format="", pen p=nullpen)
+ align align=S, string format="", pen p=currentpen)
{
label(pic,L,Scale(pic,z),z.x,align,format,p);
}
void labelx(picture pic=currentpicture, Label L="", real x,
- align align=S, string format="", pen p=nullpen)
+ align align=S, string format="", pen p=currentpen)
{
labelx(pic,L,(x,pic.scale.y.scale.logarithmic ? 1 : 0),align,format,p);
}
@@ -1762,19 +1764,19 @@ void labelx(picture pic=currentpicture, Label L,
// Put a label on the y axis.
void labely(picture pic=currentpicture, Label L="", explicit pair z,
- align align=W, string format="", pen p=nullpen)
+ align align=W, string format="", pen p=currentpen)
{
label(pic,L,Scale(pic,z),z.y,align,format,p);
}
void labely(picture pic=currentpicture, Label L="", real y,
- align align=W, string format="", pen p=nullpen)
+ align align=W, string format="", pen p=currentpen)
{
labely(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0,y),align,format,p);
}
void labely(picture pic=currentpicture, Label L,
- string format="", explicit pen p=nullpen)
+ string format="", explicit pen p=currentpen)
{
labely(pic,L,L.position.position,format,p);
}
diff --git a/Master/texmf/asymptote/graph3.asy b/Master/texmf/asymptote/graph3.asy
index 391b72ca87a..91e5194bea9 100644
--- a/Master/texmf/asymptote/graph3.asy
+++ b/Master/texmf/asymptote/graph3.asy
@@ -545,10 +545,20 @@ void xaxis3At(picture pic=currentpicture, Label L="", axis axis,
ztrans(t,z)) : (xmin,y,z);
triple b=xmax == infinity ? tinv*(rt.x-max3(p).x,ytrans(t,y),
ztrans(t,z)) : (xmax,y,z);
- triple a2=xmin == -infinity ? tinv*(lb.x-min3(p).x,ytrans(t,y2),
- ztrans(t,z2)) : (xmin,y2,z2);
- triple b2=xmax == infinity ? tinv*(rt.x-max3(p).x,ytrans(t,y2),
- ztrans(t,z2)) : (xmax,y2,z2);
+ real y0;
+ real z0;
+ if(abs(dir.y) < abs(dir.z)) {
+ y0=y;
+ z0=z2;
+ } else {
+ y0=y2;
+ z0=z;
+ }
+
+ triple a2=xmin == -infinity ? tinv*(lb.x-min3(p).x,ytrans(t,y0),
+ ztrans(t,z0)) : (xmin,y0,z0);
+ triple b2=xmax == infinity ? tinv*(rt.x-max3(p).x,ytrans(t,y0),
+ ztrans(t,z0)) : (xmax,y0,z0);
if(xmin == -infinity || xmax == infinity) {
bounds mx=autoscale(a.x,b.x,pic.scale.x.scale);
@@ -562,7 +572,8 @@ void xaxis3At(picture pic=currentpicture, Label L="", axis axis,
b += fuzz;
picture d;
- ticks(d,t,L,a--b,finite(y2) ? a2--b2 : nullpath3,p,arrow,margin,
+ ticks(d,t,L,a--b,finite(y0) && finite(z0) ? a2--b2 : nullpath3,
+ p,arrow,margin,
ticklocate(a.x,b.x,pic.scale.x,Dir(dir)),divisor,
opposite,primary);
add(f,t*T*tinv*d);
@@ -667,11 +678,21 @@ void yaxis3At(picture pic=currentpicture, Label L="", axis axis,
ztrans(t,z)) : (x,ymin,z);
triple b=ymax == infinity ? tinv*(xtrans(t,x),rt.y-max3(p).y,
ztrans(t,z)) : (x,ymax,z);
- triple a2=ymin == -infinity ? tinv*(xtrans(t,x2),lb.y-min3(p).y,
- ztrans(t,z2)) : (x2,ymin,z2);
- triple b2=ymax == infinity ? tinv*(xtrans(t,x2),rt.y-max3(p).y,
- ztrans(t,z2)) : (x2,ymax,z2);
-
+ real x0;
+ real z0;
+ if(abs(dir.x) < abs(dir.z)) {
+ x0=x;
+ z0=z2;
+ } else {
+ x0=x2;
+ z0=z;
+ }
+
+ triple a2=ymin == -infinity ? tinv*(xtrans(t,x0),lb.y-min3(p).y,
+ ztrans(t,z0)) : (x0,ymin,z0);
+ triple b2=ymax == infinity ? tinv*(xtrans(t,x0),rt.y-max3(p).y,
+ ztrans(t,z0)) : (x0,ymax,z0);
+
if(ymin == -infinity || ymax == infinity) {
bounds my=autoscale(a.y,b.y,pic.scale.y.scale);
pic.scale.y.tickMin=my.min;
@@ -684,7 +705,8 @@ void yaxis3At(picture pic=currentpicture, Label L="", axis axis,
b += fuzz;
picture d;
- ticks(d,t,L,a--b,finite(x2) ? a2--b2 : nullpath3,p,arrow,margin,
+ ticks(d,t,L,a--b,finite(x0) && finite(z0) ? a2--b2 : nullpath3,
+ p,arrow,margin,
ticklocate(a.y,b.y,pic.scale.y,Dir(dir)),divisor,
opposite,primary);
add(f,t*T*tinv*d);
@@ -789,10 +811,20 @@ void zaxis3At(picture pic=currentpicture, Label L="", axis axis,
lb.z-min3(p).z) : (x,y,zmin);
triple b=zmax == infinity ? tinv*(xtrans(t,x),ytrans(t,y),
rt.z-max3(p).z) : (x,y,zmax);
- triple a2=zmin == -infinity ? tinv*(xtrans(t,x2),ytrans(t,y2),
- lb.z-min3(p).z) : (x2,y2,zmin);
- triple b2=zmax == infinity ? tinv*(xtrans(t,x2),ytrans(t,y2),
- rt.z-max3(p).z) : (x2,y2,zmax);
+ real x0;
+ real y0;
+ if(abs(dir.x) < abs(dir.y)) {
+ x0=x;
+ y0=y2;
+ } else {
+ x0=x2;
+ y0=y;
+ }
+
+ triple a2=zmin == -infinity ? tinv*(xtrans(t,x0),ytrans(t,y0),
+ lb.z-min3(p).z) : (x0,y0,zmin);
+ triple b2=zmax == infinity ? tinv*(xtrans(t,x0),ytrans(t,y0),
+ rt.z-max3(p).z) : (x0,y0,zmax);
if(zmin == -infinity || zmax == infinity) {
bounds mz=autoscale(a.z,b.z,pic.scale.z.scale);
@@ -806,7 +838,8 @@ void zaxis3At(picture pic=currentpicture, Label L="", axis axis,
b += fuzz;
picture d;
- ticks(d,t,L,a--b,finite(x2) ? a2--b2 : nullpath3,p,arrow,margin,
+ ticks(d,t,L,a--b,finite(x0) && finite(y0) ? a2--b2 : nullpath3,
+ p,arrow,margin,
ticklocate(a.z,b.z,pic.scale.z,Dir(dir)),divisor,
opposite,primary);
add(f,t*T*tinv*d);
@@ -1189,6 +1222,7 @@ real ScaleZ(picture pic=currentpicture, real z)
void tick(picture pic=currentpicture, triple v, triple dir, real size=Ticksize,
pen p=currentpen)
{
+ triple v=Scale(pic,v);
pic.add(new void (picture f, transform3 t) {
triple tv=t*v;
draw(f,tv--tv+unit(dir)*size,p);
@@ -1200,27 +1234,27 @@ void tick(picture pic=currentpicture, triple v, triple dir, real size=Ticksize,
void xtick(picture pic=currentpicture, triple v, triple dir=Y,
real size=Ticksize, pen p=currentpen)
{
- tick(pic,Scale(pic,v),dir,size,p);
+ tick(pic,v,dir,size,p);
}
void xtick3(picture pic=currentpicture, real x, triple dir=Y,
real size=Ticksize, pen p=currentpen)
{
- xtick(pic,(x,pic.scale.y.scale.logarithmic ? 1 : 0,
+ tick(pic,(x,pic.scale.y.scale.logarithmic ? 1 : 0,
pic.scale.z.scale.logarithmic ? 1 : 0),dir,size,p);
}
void ytick(picture pic=currentpicture, triple v, triple dir=X,
real size=Ticksize, pen p=currentpen)
{
- xtick(pic,v,dir,size,p);
+ tick(pic,v,dir,size,p);
}
-void ytick(picture pic=currentpicture, real y, triple dir=X,
- real size=Ticksize, pen p=currentpen)
+void ytick3(picture pic=currentpicture, real y, triple dir=X,
+ real size=Ticksize, pen p=currentpen)
{
- xtick(pic,(pic.scale.x.scale.logarithmic ? 1 : 0,y,
- pic.scale.z.scale.logarithmic ? 1 : 0),dir,size,p);
+ tick(pic,(pic.scale.x.scale.logarithmic ? 1 : 0,y,
+ pic.scale.z.scale.logarithmic ? 1 : 0),dir,size,p);
}
void ztick(picture pic=currentpicture, triple v, triple dir=X,
@@ -1229,8 +1263,8 @@ void ztick(picture pic=currentpicture, triple v, triple dir=X,
xtick(pic,v,dir,size,p);
}
-void ztick(picture pic=currentpicture, real z, triple dir=X,
- real size=Ticksize, pen p=currentpen)
+void ztick3(picture pic=currentpicture, real z, triple dir=X,
+ real size=Ticksize, pen p=currentpen)
{
xtick(pic,(pic.scale.x.scale.logarithmic ? 1 : 0,
pic.scale.y.scale.logarithmic ? 1 : 0,z),dir,size,p);
@@ -1241,15 +1275,14 @@ void tick(picture pic=currentpicture, Label L, real value, triple v,
{
Label L=L.copy();
L.align(L.align,-dir);
- if(shift(L.T3)*O == O) {
+ if(shift(L.T3)*O == O)
L.T3=shift(dot(dir,L.align.dir3) > 0 ? dir*size :
ticklabelshift(L.align.dir3,p))*L.T3;
- }
L.p(p);
if(L.s == "") L.s=format(format == "" ? defaultformat : format,value);
L.s=baseline(L.s,baselinetemplate);
- label(pic,L,v);
- xtick(pic,v,dir,size,p);
+ label(pic,L,Scale(pic,v));
+ tick(pic,v,dir,size,p);
}
void xtick(picture pic=currentpicture, Label L, triple v, triple dir=Y,
@@ -1262,7 +1295,7 @@ void xtick3(picture pic=currentpicture, Label L, real x, triple dir=Y,
string format="", real size=Ticksize, pen p=currentpen)
{
xtick(pic,L,(x,pic.scale.y.scale.logarithmic ? 1 : 0,
- pic.scale.z.scale.logarithmic ? 1 : 0),dir,size,p);
+ pic.scale.z.scale.logarithmic ? 1 : 0),dir,size,p);
}
void ytick(picture pic=currentpicture, Label L, triple v, triple dir=X,
@@ -1274,8 +1307,8 @@ void ytick(picture pic=currentpicture, Label L, triple v, triple dir=X,
void ytick3(picture pic=currentpicture, Label L, real y, triple dir=X,
string format="", real size=Ticksize, pen p=currentpen)
{
- ytick(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0,y,
- pic.scale.z.scale.logarithmic ? 1 : 0),dir,format,size,p);
+ xtick(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0,y,
+ pic.scale.z.scale.logarithmic ? 1 : 0),dir,format,size,p);
}
void ztick(picture pic=currentpicture, Label L, triple v, triple dir=X,
@@ -1287,8 +1320,8 @@ void ztick(picture pic=currentpicture, Label L, triple v, triple dir=X,
void ztick3(picture pic=currentpicture, Label L, real z, triple dir=X,
string format="", real size=Ticksize, pen p=currentpen)
{
- ztick(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0,
- pic.scale.z.scale.logarithmic ? 1 : 0,z),dir,format,size,p);
+ xtick(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0,
+ pic.scale.z.scale.logarithmic ? 1 : 0,z),dir,format,size,p);
}
private void label(picture pic, Label L, triple v, real x, align align,
@@ -1305,39 +1338,39 @@ private void label(picture pic, Label L, triple v, real x, align align,
}
void labelx(picture pic=currentpicture, Label L="", triple v,
- align align=-Y, string format="", pen p=nullpen)
+ align align=-Y, string format="", pen p=currentpen)
{
label(pic,L,Scale(pic,v),v.x,align,format,p);
}
void labelx3(picture pic=currentpicture, Label L="", real x,
- align align=-Y, string format="", pen p=nullpen)
+ align align=-Y, string format="", pen p=currentpen)
{
labelx(pic,L,(x,pic.scale.y.scale.logarithmic ? 1 : 0,
pic.scale.z.scale.logarithmic ? 1 : 0),align,format,p);
}
void labely(picture pic=currentpicture, Label L="", triple v,
- align align=-X, string format="", pen p=nullpen)
+ align align=-X, string format="", pen p=currentpen)
{
label(pic,L,Scale(pic,v),v.y,align,format,p);
}
void labely3(picture pic=currentpicture, Label L="", real y,
- align align=-X, string format="", pen p=nullpen)
+ align align=-X, string format="", pen p=currentpen)
{
labely(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0,y,
pic.scale.z.scale.logarithmic ? 1 : 0),align,format,p);
}
void labelz(picture pic=currentpicture, Label L="", triple v,
- align align=-X, string format="", pen p=nullpen)
+ align align=-X, string format="", pen p=currentpen)
{
label(pic,L,Scale(pic,v),v.z,align,format,p);
}
void labelz3(picture pic=currentpicture, Label L="", real z,
- align align=-X, string format="", pen p=nullpen)
+ align align=-X, string format="", pen p=currentpen)
{
labelz(pic,L,(pic.scale.x.scale.logarithmic ? 1 : 0,
pic.scale.y.scale.logarithmic ? 1 : 0,z),align,format,p);
diff --git a/Master/texmf/asymptote/palette.asy b/Master/texmf/asymptote/palette.asy
index 9a2d1845604..b1d1985a323 100644
--- a/Master/texmf/asymptote/palette.asy
+++ b/Master/texmf/asymptote/palette.asy
@@ -54,14 +54,10 @@ pen[] adjust(picture pic, real min, real max, real rmin, real rmax,
real factor=palette.length/delta;
int minindex=floor(factor*(dmin-rmin));
if(minindex < 0) minindex=0;
- int maxindex=floor(factor*(dmax-rmin));
+ int maxindex=ceil(factor*(dmax-rmin));
if(maxindex > palette.length) maxindex=palette.length;
- if(minindex > 0 || maxindex < palette.length) {
- pen[] newpalette;
- for(int i=minindex; i < maxindex; ++i)
- newpalette.push(palette[i]);
- return newpalette;
- }
+ if(minindex > 0 || maxindex < palette.length)
+ return palette[minindex:maxindex];
}
return palette;
}
@@ -170,6 +166,8 @@ bounds image(picture pic=currentpicture, pair[] z, real[] f,
real rmax=pic.scale.z.T(bounds.max);
palette=adjust(pic,m,M,rmin,rmax,palette);
+ rmin=max(rmin,m);
+ rmax=min(rmax,M);
// Crop data to allowed range and scale
if(range != Full || pic.scale.z.scale.T != identity ||
diff --git a/Master/texmf/asymptote/plain_Label.asy b/Master/texmf/asymptote/plain_Label.asy
index 623619f4a0c..a559ae88298 100644
--- a/Master/texmf/asymptote/plain_Label.asy
+++ b/Master/texmf/asymptote/plain_Label.asy
@@ -1,12 +1,3 @@
-// A rotation in the direction dir limited to [-90,90]
-// This is useful for rotating text along a line in the direction dir.
-transform rotate(explicit pair dir)
-{
- real angle=degrees(dir);
- if(angle > 90 && angle < 270) angle -= 180;
- return rotate(angle);
-}
-
real angle(transform t)
{
pair z=(2t.xx*t.yy,t.yx*t.yy-t.xx*t.xy);
@@ -475,27 +466,27 @@ void label(frame f, Label L, align align=NoAlign,
}
void label(picture pic=currentpicture, Label L, pair position,
- align align=NoAlign, pen p=nullpen, filltype filltype=NoFill)
+ align align=NoAlign, pen p=currentpen, filltype filltype=NoFill)
{
Label L=Label(L,position,align,p,filltype);
add(pic,L);
}
void label(picture pic=currentpicture, Label L, align align=NoAlign,
- pen p=nullpen, filltype filltype=NoFill)
+ pen p=currentpen, filltype filltype=NoFill)
{
label(pic,L,L.position,align,p,filltype);
}
void label(picture pic=currentpicture, Label L, explicit path g,
- align align=NoAlign, pen p=nullpen, filltype filltype=NoFill)
+ align align=NoAlign, pen p=currentpen, filltype filltype=NoFill)
{
Label L=Label(L,align,p,filltype);
L.out(pic,g);
}
void label(picture pic=currentpicture, Label L, explicit guide g,
- align align=NoAlign, pen p=nullpen, filltype filltype=NoFill)
+ align align=NoAlign, pen p=currentpen, filltype filltype=NoFill)
{
label(pic,L,(path) g,align,p,filltype);
}
diff --git a/Master/texmf/asymptote/plain_bounds.asy b/Master/texmf/asymptote/plain_bounds.asy
index 71c304da02f..871d82f01b5 100644
--- a/Master/texmf/asymptote/plain_bounds.asy
+++ b/Master/texmf/asymptote/plain_bounds.asy
@@ -346,10 +346,14 @@ private struct freezableBounds {
addMaxToExtremes(e, max(pathBounds), (0,0));
}
- for (var pp : pathpenBounds) {
- if (pp.g.length > 0) {
- addMinToExtremes(e, min(pp.g), min(pp.p));
- addMaxToExtremes(e, max(pp.g), max(pp.p));
+ for(var pp : pathpenBounds) {
+ pair m=min(pp.p);
+ pair M=max(pp.p);
+ for(path gg : pp.g) {
+ if (size(gg) > 0) {
+ addMinToExtremes(e,min(gg),m);
+ addMaxToExtremes(e,max(gg),M);
+ }
}
}
}
@@ -396,7 +400,7 @@ private struct freezableBounds {
// would be easily computable from extremes, except that the picture
// interface actually allows calls that manually change the usermin and
// usermax values. Therefore, we have to compute these values separately.
- private static struct bounds {
+ private static struct userbounds {
bool areSet=false;
pair min;
pair max;
@@ -410,15 +414,15 @@ private struct freezableBounds {
maxs.push(M);
}
- void push(bounds b) {
+ void push(userbounds b) {
if (b.areSet)
push(b.min, b.max);
}
- void push(transform t, bounds b) {
+ void push(transform t, userbounds b) {
if (b.areSet) {
pair[] box = { t*(b.min.x,b.max.y), t*b.max,
- t*b.min.x, t*(b.min.x,b.max.y) };
+ t*b.min, t*(b.max.x,b.min.y) };
for (var z : box)
push(z,z);
}
@@ -435,8 +439,8 @@ private struct freezableBounds {
(max.x[i].user, max.y[i].user));
}
- bounds collapse() {
- bounds b;
+ userbounds collapse() {
+ userbounds b;
if (mins.length > 0) {
b.areSet = true;
b.min = minbound(mins);
@@ -450,7 +454,7 @@ private struct freezableBounds {
}
// The user bounds already calculated for this data.
- private bounds storedUserBounds = null;
+ private userbounds storedUserBounds = null;
private void accumulateUserBounds(boundsAccumulator acc)
{
@@ -483,7 +487,7 @@ private struct freezableBounds {
storedUserBounds = acc.collapse();
}
- private bounds userBounds() {
+ private userbounds userBounds() {
if (storedUserBounds == null)
computeUserBounds();
@@ -565,7 +569,7 @@ private struct freezableBounds {
max.xclip(Min,Max);
// Cap the userBounds.
- bounds b = storedUserBounds;
+ userbounds b = storedUserBounds;
b.min = (max(Min, b.min.x), b.min.y);
b.max = (min(Max, b.max.x), b.max.y);
}
@@ -578,7 +582,7 @@ private struct freezableBounds {
max.yclip(Min,Max);
// Cap the userBounds.
- bounds b = storedUserBounds;
+ userbounds b = storedUserBounds;
b.min = (b.min.x, max(Min, b.min.y));
b.max = (b.max.x, min(Max, b.max.y));
}
diff --git a/Master/texmf/asymptote/plain_constants.asy b/Master/texmf/asymptote/plain_constants.asy
index d41cfb770b8..bf6988d4c42 100644
--- a/Master/texmf/asymptote/plain_constants.asy
+++ b/Master/texmf/asymptote/plain_constants.asy
@@ -57,8 +57,8 @@ bool finite(triple v)
return abs(v.x) < infinity && abs(v.y) < infinity && abs(v.z) < infinity;
}
-restricted file stdin=input("");
-restricted file stdout=output("");
+restricted file stdin=input();
+restricted file stdout=output();
void none(file file) {}
void endl(file file) {write(file,'\n',flush);}
@@ -101,8 +101,8 @@ struct bool3 {
void write(file file, string s="", bool3 b, suffix suffix=none)
{
- if(b.set) write(b.value);
- else write("default");
+ if(b.set) write(b.value,suffix);
+ else write("default",suffix);
}
void write(string s="", bool3 b, suffix suffix=endl)
diff --git a/Master/texmf/asymptote/plain_markers.asy b/Master/texmf/asymptote/plain_markers.asy
index 67b218f716d..42b4e8a036c 100644
--- a/Master/texmf/asymptote/plain_markers.asy
+++ b/Master/texmf/asymptote/plain_markers.asy
@@ -117,22 +117,43 @@ marker marker(path[] g, markroutine markroutine=marknodes, pen p=currentpen,
return marker(f,markroutine,above);
}
+// On picture pic, add path g with opacity thinning about every node.
+marker markthin(path g, pen p=currentpen,
+ real thin(real fraction)=new real(real x) {return x^2;},
+ filltype filltype=NoFill) {
+ marker M=new marker;
+ M.above=true;
+ filltype.fill(M.f,g,p);
+ real factor=1/abs(size(M.f));
+ M.markroutine=new void(picture pic=currentpicture, frame, path G) {
+ transform t=pic.calculateTransform();
+ int n=size(G);
+ for(int i=0; i < n; ++i) {
+ pair z=point(G,i);
+ frame f;
+ real fraction=1;
+ if(i > 0) fraction=min(fraction,abs(t*(z-point(G,i-1)))*factor);
+ if(i < n-1) fraction=min(fraction,abs(t*(point(G,i+1)-z))*factor);
+ filltype.fill(f,g,p+opacity(thin(fraction)));
+ add(pic,f,point(G,i));
+ }
+ };
+ return M;
+}
+
marker nomarker;
real circlescale=0.85;
-marker[] Mark={
- marker(scale(circlescale)*unitcircle),
- marker(polygon(3)),marker(polygon(4)),
- marker(polygon(5)),marker(invert*polygon(3)),
- marker(cross(4)),marker(cross(6))
-};
-
-marker[] MarkFill={
- marker(scale(circlescale)*unitcircle,Fill),marker(polygon(3),Fill),
- marker(polygon(4),Fill),marker(polygon(5),Fill),
- marker(invert*polygon(3),Fill)
-};
+path[] MarkPath={scale(circlescale)*unitcircle,
+ polygon(3),polygon(4),polygon(5),invert*polygon(3),
+ cross(4),cross(6)};
+
+marker[] Mark=sequence(new marker(int i) {return marker(MarkPath[i]);},
+ MarkPath.length);
+
+marker[] MarkFill=sequence(new marker(int i) {return marker(MarkPath[i],Fill);},
+ MarkPath.length-2);
marker Mark(int n)
{
diff --git a/Master/texmf/asymptote/plain_paths.asy b/Master/texmf/asymptote/plain_paths.asy
index b073e8090ec..c768922ffd1 100644
--- a/Master/texmf/asymptote/plain_paths.asy
+++ b/Master/texmf/asymptote/plain_paths.asy
@@ -204,9 +204,9 @@ pair dir(path p)
return dir(p,length(p));
}
-pair dir(path p, path g)
+pair dir(path p, path q)
{
- return unit(dir(p)+dir(g));
+ return unit(dir(p)+dir(q));
}
// return the point on path p at arclength L
diff --git a/Master/texmf/asymptote/plain_strings.asy b/Master/texmf/asymptote/plain_strings.asy
index 98f72f460aa..a466159d9c7 100644
--- a/Master/texmf/asymptote/plain_strings.asy
+++ b/Master/texmf/asymptote/plain_strings.asy
@@ -5,6 +5,7 @@ string defaultformat(int n, string trailingzero="", bool fixed=false,
}
string defaultformat=defaultformat(4);
+string defaultseparator="\!\times\!";
string ask(string prompt)
{
@@ -208,9 +209,14 @@ string math(real x)
return math((string) x);
}
+string format(string format, real x, string locale="")
+{
+ return format(format,defaultseparator,x,locale);
+}
+
string format(real x, string locale="")
{
- return format(defaultformat,x,locale);
+ return format(defaultformat,defaultseparator,x,locale);
}
string phantom(string s)
diff --git a/Master/texmf/asymptote/solids.asy b/Master/texmf/asymptote/solids.asy
index 239bce4b9a0..e6613fc29c5 100644
--- a/Master/texmf/asymptote/solids.asy
+++ b/Master/texmf/asymptote/solids.asy
@@ -35,8 +35,7 @@ path line(path p, path q, real[] t)
// Return the projection of a generalized cylinder of height h constructed
// from area base in the XY plane and aligned with axis.
-path[] cylinder(path3 base, real h, triple axis=Z,
- projection P=currentprojection)
+path[] cylinder(path3 base, real h, triple axis=Z, projection P)
{
base=rotate(-colatitude(axis),cross(axis,Z))*base;
path3 top=shift(h*axis)*base;
@@ -84,14 +83,6 @@ struct revolution {
m=min(g);
}
- // Return the surface of rotation obtain by rotating the path3 (x,0,f(x))
- // sampled n times between x=a and x=b about an axis lying in the XZ plane.
- void operator init(triple c=O, real f(real x), real a, real b, int n=ngraph,
- interpolate3 join=operator --, triple axis=Z,
- real angle1=0, real angle2=360) {
- operator init(c,graph(new triple(real x) {return (x,0,f(x));},a,b,n,
- join),axis,angle1,angle2);
- }
revolution copy() {
return revolution(c,g,axis,angle1,angle2);
@@ -134,9 +125,7 @@ struct revolution {
}
// add transverse slice to skeleton s;
- // must be recomputed if camera is adjusted
- void transverse(skeleton s, real t, int n=nslice,
- projection P=currentprojection) {
+ void transverse(skeleton s, real t, int n=nslice, projection P) {
skeleton.curve s=s.transverse;
path3 S=slice(t,n);
triple camera=camera(P);
@@ -192,8 +181,7 @@ struct revolution {
}
// add m evenly spaced transverse slices to skeleton s
- void transverse(skeleton s, int m=0, int n=nslice,
- projection P=currentprojection) {
+ void transverse(skeleton s, int m=0, int n=nslice, projection P) {
if(m == 0) {
int N=size(g);
for(int i=0; i < N; ++i)
@@ -281,8 +269,7 @@ struct revolution {
}
// add longitudinal curves to skeleton;
- // must be recomputed if camera is adjusted
- void longitudinal(skeleton s, int n=nslice, projection P=currentprojection) {
+ void longitudinal(skeleton s, int n=nslice, projection P) {
real t, d=0;
// Find a point on g of maximal distance from the axis.
int N=size(g);
@@ -326,7 +313,7 @@ struct revolution {
push(t2);
}
- skeleton skeleton(int m=0, int n=nslice, projection P=currentprojection) {
+ skeleton skeleton(int m=0, int n=nslice, projection P) {
skeleton s;
transverse(s,m,n,P);
longitudinal(s,n,P);
@@ -349,18 +336,43 @@ void draw(picture pic=currentpicture, revolution r, int m=0, int n=nslice,
light light=currentlight, string name="",
render render=defaultrender, projection P=currentprojection)
{
- pen thin=is3D() ? thin() : defaultpen;
- skeleton s=r.skeleton(m,n,P);
- begingroup3(pic,name == "" ? "skeleton" : name,render);
- if(frontpen != nullpen) {
- draw(pic,s.transverse.back,thin+defaultbackpen+backpen,light);
- draw(pic,s.transverse.front,thin+frontpen,light);
- }
- if(longitudinalpen != nullpen) {
- draw(pic,s.longitudinal.back,thin+defaultbackpen+longitudinalbackpen,light);
- draw(pic,s.longitudinal.front,thin+longitudinalpen,light);
+ if(is3D()) {
+ pen thin=thin();
+ void drawskeleton(frame f, transform3 t, projection P) {
+ skeleton s=r.skeleton(m,n,inverse(t)*P);
+ if(frontpen != nullpen) {
+ draw(f,t*s.transverse.back,thin+defaultbackpen+backpen,light);
+ draw(f,t*s.transverse.front,thin+frontpen,light);
+ }
+ if(longitudinalpen != nullpen) {
+ draw(f,t*s.longitudinal.back,thin+defaultbackpen+longitudinalbackpen,
+ light);
+ draw(f,t*s.longitudinal.front,thin+longitudinalpen,light);
+ }
+ }
+
+ begingroup3(pic,name == "" ? "skeleton" : name,render);
+ pic.add(new void(frame f, transform3 t, picture pic, projection P) {
+ drawskeleton(f,t,P);
+ if(pic != null)
+ pic.addBox(min(f,P),max(f,P),min(frontpen),max(frontpen));
+ });
+ frame f;
+ drawskeleton(f,identity4,P);
+ pic.addBox(min3(f),max3(f));
+ endgroup3(pic);
+ } else {
+ skeleton s=r.skeleton(m,n,P);
+ if(frontpen != nullpen) {
+ draw(pic,s.transverse.back,defaultbackpen+backpen,light);
+ draw(pic,s.transverse.front,frontpen,light);
+ }
+ if(longitudinalpen != nullpen) {
+ draw(pic,s.longitudinal.back,defaultbackpen+longitudinalbackpen,
+ light);
+ draw(pic,s.longitudinal.front,longitudinalpen,light);
+ }
}
- endgroup3(pic);
}
revolution operator * (transform3 t, revolution r)
diff --git a/Master/texmf/asymptote/three.asy b/Master/texmf/asymptote/three.asy
index 033461263eb..5d7ae1a8ba5 100644
--- a/Master/texmf/asymptote/three.asy
+++ b/Master/texmf/asymptote/three.asy
@@ -328,6 +328,16 @@ projection orthographic(real x, real y, real z, triple up=Z,
center=center);
}
+// Compute camera position with x axis below the horizontal at angle alpha,
+// y axis below the horizontal at angle beta, and z axis up.
+triple camera(real alpha, real beta)
+{
+ real denom=Tan(alpha+beta);
+ real Tanalpha=Tan(alpha);
+ real Tanbeta=Tan(beta);
+ return (sqrt(Tanalpha/denom),sqrt(Tanbeta/denom),sqrt(Tanalpha*Tanbeta));
+}
+
projection oblique(real angle=45)
{
transform3 t=identity(4);
@@ -2830,13 +2840,13 @@ struct scene
return b == 0 ? (0.5*(a.x+a.y)) :
(b.x^2*a.x+b.y^2*a.y)/(b.x^2+b.y^2);
}
- pic2.erase();
transform3 s=keepAspect ? scale3(min(f(v,x),f(v,y),f(v,z))) :
xscale3(f(v,x))*yscale3(f(v,y))*zscale3(f(v,z));
s=shift(this.P.target)*s*shift(-this.P.target);
t=s*t;
this.P=s*this.P;
this.P.bboxonly=false;
+ if(!is3D) pic2.erase();
f=pic.fit3(t,is3D ? null : pic2,this.P);
}
@@ -2988,6 +2998,11 @@ object embed(string label="", string text=label, string prefix=defaultfilename,
if((preview || (prc && settings.render == 0)) && settings.embed) {
image=prefix;
if(settings.inlinetex) image += "_0";
+ if(!preview && !shipped && !S.pic2.empty2()) {
+ transform T=S.pic2.scaling(S.width,S.height);
+ shipout(image,S.pic2.fit(T),newframe,nativeformat(),false,false,null);
+ }
+
image += "."+nativeformat();
if(!settings.inlinetex) file3.push(image);
image=graphic(image,"hiresbb");
@@ -3019,7 +3034,7 @@ object embed(string label="", string text=label,
object F;
transform T=S.pic2.scaling(xsize,ysize,keepAspect);
F.f=pic.fit(scale(S.t[0][0])*T);
- add(F.f,S.pic2.fit(T));
+ add(F.f,S.pic2.fit());
return F;
}
}
diff --git a/Master/texmf/asymptote/three_arrows.asy b/Master/texmf/asymptote/three_arrows.asy
index d81650ec948..8346a5bc6c1 100644
--- a/Master/texmf/asymptote/three_arrows.asy
+++ b/Master/texmf/asymptote/three_arrows.asy
@@ -25,9 +25,9 @@ transform3 bend(path3 g, real t)
triple q=point(g,t);
return new real[][] {
{u.x,w.x,dir.x,q.x},
- {u.y,w.y,dir.y,q.y},
- {u.z,w.z,dir.z,q.z},
- {0,0,0,1}
+ {u.y,w.y,dir.y,q.y},
+ {u.z,w.z,dir.z,q.z},
+ {0,0,0,1}
};
}
@@ -150,23 +150,25 @@ DefaultHead3.head=new surface(path3 g, position position=EndPoint,
bool first=true;
for(int i=0; i < n; ++i) {
render(subpath(s,i,i+1),new void(path3 q, real) {
- real l=arclength(q);
- real w=remainL*aspect;
- surface segment=scale(w,w,l)*unitcylinder;
- if(first) { // add base
- first=false;
- segment.append(scale(w,w,1)*unitdisk);
- }
- for(patch p : segment.s) {
- for(int i=0; i < 4; ++i) {
- for(int j=0; j < 4; ++j) {
- real k=1-p.P[i][j].z/remainL;
- p.P[i][j]=bend((k*p.P[i][j].x,k*p.P[i][j].y,p.P[i][j].z),q,l);
+ if(remainL > 0) {
+ real l=arclength(q);
+ real w=remainL*aspect;
+ surface segment=scale(w,w,l)*unitcylinder;
+ if(first) { // add base
+ first=false;
+ segment.append(scale(w,w,1)*unitdisk);
+ }
+ for(patch p : segment.s) {
+ for(int i=0; i < 4; ++i) {
+ for(int j=0; j < 4; ++j) {
+ real k=1-p.P[i][j].z/remainL;
+ p.P[i][j]=bend((k*p.P[i][j].x,k*p.P[i][j].y,p.P[i][j].z),q,l);
+ }
+ }
}
+ head.append(segment);
+ remainL -= l;
}
- }
- head.append(segment);
- remainL -= l;
});
}
}
@@ -263,12 +265,12 @@ arrowhead3 DefaultHead2(triple normal=O) {
real angle=arrowangle,
filltype filltype=null, bool forwards=true,
projection P=currentprojection) {
- if(size == 0) size=a.size(p);
- path h=a.project(g,forwards,P);
- a.size=min(size,arclength(h));
- path[] H=a.align(DefaultHead.head(h,p,size,angle),h);
- H=forwards ? yscale(-1)*H : H;
- return a.surface(g,position,size,H,p,filltype,normal,P);
+ if(size == 0) size=a.size(p);
+ path h=a.project(g,forwards,P);
+ a.size=min(size,arclength(h));
+ path[] H=a.align(DefaultHead.head(h,p,size,angle),h);
+ H=forwards ? yscale(-1)*H : H;
+ return a.surface(g,position,size,H,p,filltype,normal,P);
};
a.gap=1.005;
return a;
@@ -301,15 +303,15 @@ arrowhead3 TeXHead2(triple normal=O) {
pen p=currentpen, real size=0,
real angle=arrowangle, filltype filltype=null,
bool forwards=true, projection P=currentprojection) {
- if(size == 0) size=a.size(p);
- path h=a.project(g,forwards,P);
- a.size=min(size,arclength(h));
- h=rotate(-degrees(dir(h,length(h)),warn=false))*h;
- path[] H=TeXHead.head(h,p,size,angle);
- H=forwards ? yscale(-1)*H : H;
- return a.surface(g,position,size,H,p,
- filltype == null ? TeXHead.defaultfilltype(p) : filltype,
- normal,P);
+ if(size == 0) size=a.size(p);
+ path h=a.project(g,forwards,P);
+ a.size=min(size,arclength(h));
+ h=rotate(-degrees(dir(h,length(h)),warn=false))*h;
+ path[] H=TeXHead.head(h,p,size,angle);
+ H=forwards ? yscale(-1)*H : H;
+ return a.surface(g,position,size,H,p,
+ filltype == null ? TeXHead.defaultfilltype(p) : filltype,
+ normal,P);
};
a.arrowhead2=TeXHead;
a.size=TeXHead.size;
diff --git a/Master/texmf/asymptote/three_surface.asy b/Master/texmf/asymptote/three_surface.asy
index 88e42cf6640..7d356e45e22 100644
--- a/Master/texmf/asymptote/three_surface.asy
+++ b/Master/texmf/asymptote/three_surface.asy
@@ -17,7 +17,7 @@ struct patch {
bool3 planar; // Patch is planar.
path3 external() {
- return
+ return straight ? P[0][0]--P[3][0]--P[3][3]--P[0][3]--cycle :
P[0][0]..controls P[1][0] and P[2][0]..
P[3][0]..controls P[3][1] and P[3][2]..
P[3][3]..controls P[2][3] and P[1][3]..
@@ -93,9 +93,16 @@ struct patch {
static real fuzz=1000*realEpsilon;
+ triple partialu(real u, real v) {
+ return bezier(BuP(0,u),BuP(1,u),BuP(2,u),BuP(3,u),v);
+ }
+
+ triple partialv(real u, real v) {
+ return bezier(BvP(0,v),BvP(1,v),BvP(2,v),BvP(3,v),u);
+ }
+
triple normal(real u, real v) {
- triple n=cross(bezier(BuP(0,u),BuP(1,u),BuP(2,u),BuP(3,u),v),
- bezier(BvP(0,v),BvP(1,v),BvP(2,v),BvP(3,v),u));
+ triple n=cross(partialu(u,v),partialv(u,v));
real epsilon=fuzz*change2(P);
return (abs(n) > epsilon) ? n : normal0(u,v,epsilon);
}
@@ -940,59 +947,105 @@ private triple[] split(triple z0, triple c0, triple c1, triple z1, real t=0.5)
// produced by a horizontal split of P
triple[][][] hsplit(triple[][] P)
{
- // get control points in rows
- triple[] P0=P[0];
- triple[] P1=P[1];
- triple[] P2=P[2];
- triple[] P3=P[3];
-
- triple[] c0=split(P0[0],P1[0],P2[0],P3[0]);
- triple[] c1=split(P0[1],P1[1],P2[1],P3[1]);
- triple[] c2=split(P0[2],P1[2],P2[2],P3[2]);
- triple[] c3=split(P0[3],P1[3],P2[3],P3[3]);
- // bottom, top
- return new triple[][][] {
- {{c0[2],c1[2],c2[2],c3[2]},
- {c0[3],c1[3],c2[3],c3[3]},
- {c0[4],c1[4],c2[4],c3[4]},
- {P3[0],P3[1],P3[2],P3[3]}},
- {{P0[0],P0[1],P0[2],P0[3]},
- {c0[0],c1[0],c2[0],c3[0]},
- {c0[1],c1[1],c2[1],c3[1]},
- {c0[2],c1[2],c2[2],c3[2]}}
- };
+ // get control points in rows
+ triple[] P0=P[0];
+ triple[] P1=P[1];
+ triple[] P2=P[2];
+ triple[] P3=P[3];
+
+ triple[] c0=split(P0[0],P0[1],P0[2],P0[3]);
+ triple[] c1=split(P1[0],P1[1],P1[2],P1[3]);
+ triple[] c2=split(P2[0],P2[1],P2[2],P2[3]);
+ triple[] c3=split(P3[0],P3[1],P3[2],P3[3]);
+ // bottom, top
+ return new triple[][][] {
+ {{P0[0],c0[0],c0[1],c0[2]},
+ {P1[0],c1[0],c1[1],c1[2]},
+ {P2[0],c2[0],c2[1],c2[2]},
+ {P3[0],c3[0],c3[1],c3[2]}},
+ {{c0[2],c0[3],c0[4],P0[3]},
+ {c1[2],c1[3],c1[4],P1[3]},
+ {c2[2],c2[3],c2[4],P2[3]},
+ {c3[2],c3[3],c3[4],P3[3]}}
+ };
}
// Return the control points of the subpatches
// produced by a vertical split of P
triple[][][] vsplit(triple[][] P)
{
- // get control points in rows
+ // get control points in rows
+ triple[] P0=P[0];
+ triple[] P1=P[1];
+ triple[] P2=P[2];
+ triple[] P3=P[3];
+
+ triple[] c0=split(P0[0],P1[0],P2[0],P3[0]);
+ triple[] c1=split(P0[1],P1[1],P2[1],P3[1]);
+ triple[] c2=split(P0[2],P1[2],P2[2],P3[2]);
+ triple[] c3=split(P0[3],P1[3],P2[3],P3[3]);
+ // left, right
+ return new triple[][][] {
+ {{P0[0],P0[1],P0[2],P0[3]},
+ {c0[0],c1[0],c2[0],c3[0]},
+ {c0[1],c1[1],c2[1],c3[1]},
+ {c0[2],c1[2],c2[2],c3[2]}},
+ {{c0[2],c1[2],c2[2],c3[2]},
+ {c0[3],c1[3],c2[3],c3[3]},
+ {c0[4],c1[4],c2[4],c3[4]},
+ {P3[0],P3[1],P3[2],P3[3]}}
+ };
+}
+
+// Return a 2D array of the control point arrays of the subpatches
+// produced by horizontal and vertical splits of P at u and v
+triple[][][][] split(triple[][] P, real u=1/2, real v=1/2)
+{
triple[] P0=P[0];
triple[] P1=P[1];
triple[] P2=P[2];
triple[] P3=P[3];
-
- triple[] c0=split(P0[0],P0[1],P0[2],P0[3]);
- triple[] c1=split(P1[0],P1[1],P1[2],P1[3]);
- triple[] c2=split(P2[0],P2[1],P2[2],P2[3]);
- triple[] c3=split(P3[0],P3[1],P3[2],P3[3]);
- // left, right
- return new triple[][][] {
- {{P0[0],c0[0],c0[1],c0[2]},
- {P1[0],c1[0],c1[1],c1[2]},
- {P2[0],c2[0],c2[1],c2[2]},
- {P3[0],c3[0],c3[1],c3[2]}},
-
- {{c0[2],c0[3],c0[4],P0[3]},
- {c1[2],c1[3],c1[4],P1[3]},
- {c2[2],c2[3],c2[4],P2[3]},
- {c3[2],c3[3],c3[4],P3[3]}}
- };
+
+ // slice horizontally
+ triple[] c0=split(P0[0],P0[1],P0[2],P0[3],v);
+ triple[] c1=split(P1[0],P1[1],P1[2],P1[3],v);
+ triple[] c2=split(P2[0],P2[1],P2[2],P2[3],v);
+ triple[] c3=split(P3[0],P3[1],P3[2],P3[3],v);
+
+ // bottom patch
+ triple[] c4=split(P0[0],P1[0],P2[0],P3[0],u);
+ triple[] c5=split(c0[0],c1[0],c2[0],c3[0],u);
+ triple[] c6=split(c0[1],c1[1],c2[1],c3[1],u);
+ triple[] c7=split(c0[2],c1[2],c2[2],c3[2],u);
+
+ // top patch
+ triple[] c8=split(c0[3],c1[3],c2[3],c3[3],u);
+ triple[] c9=split(c0[4],c1[4],c2[4],c3[4],u);
+ triple[] cA=split(P0[3],P1[3],P2[3],P3[3],u);
+
+// {{bottom-left, top-left}, {bottom-right, top-right}}
+ return new triple[][][][] {
+ {{{P0[0],c0[0],c0[1],c0[2]},
+ {c4[0],c5[0],c6[0],c7[0]},
+ {c4[1],c5[1],c6[1],c7[1]},
+ {c4[2],c5[2],c6[2],c7[2]}},
+ {{c0[2],c0[3],c0[4],P0[3]},
+ {c7[0],c8[0],c9[0],cA[0]},
+ {c7[1],c8[1],c9[1],cA[1]},
+ {c7[2],c8[2],c9[2],cA[2]}}},
+ {{{c4[2],c5[2],c6[2],c7[2]},
+ {c4[3],c5[3],c6[3],c7[3]},
+ {c4[4],c5[4],c6[4],c7[4]},
+ {P3[0],c3[0],c3[1],c3[2]}},
+ {{c7[2],c8[2],c9[2],cA[2]},
+ {c7[3],c8[3],c9[3],cA[3]},
+ {c7[4],c8[4],c9[4],cA[4]},
+ {c3[2],c3[3],c3[4],P3[3]}}}
+ };
}
// Return the control points for a subpatch of P on [u,1] x [v,1].
-triple[][] subpatchbegin(triple[][] P, real u, real v)
+triple[][] subpatchend(triple[][] P, real u, real v)
{
triple[] P0=P[0];
triple[] P1=P[1];
@@ -1004,21 +1057,20 @@ triple[][] subpatchbegin(triple[][] P, real u, real v)
triple[] c2=split(P2[0],P2[1],P2[2],P2[3],v);
triple[] c3=split(P3[0],P3[1],P3[2],P3[3],v);
- u=1.0-u;
-
- triple[] c7=split(c3[2],c2[2],c1[2],c0[2],u);
- triple[] c8=split(c3[3],c2[3],c1[3],c0[3],u);
- triple[] c9=split(c3[4],c2[4],c1[4],c0[4],u);
- triple[] c10=split(P3[3],P2[3],P1[3],P0[3],u);
-
- return new triple[][] {{c7[2],c8[2],c9[2],c10[2]},
- {c7[1],c8[1],c9[1],c10[1]},
- {c7[0],c8[0],c9[0],c10[0]},
+ triple[] c7=split(c0[2],c1[2],c2[2],c3[2],u);
+ triple[] c8=split(c0[3],c1[3],c2[3],c3[3],u);
+ triple[] c9=split(c0[4],c1[4],c2[4],c3[4],u);
+ triple[] cA=split(P0[3],P1[3],P2[3],P3[3],u);
+
+ return new triple[][] {
+ {c7[2],c8[2],c9[2],cA[2]},
+ {c7[3],c8[3],c9[3],cA[3]},
+ {c7[4],c8[4],c9[4],cA[4]},
{c3[2],c3[3],c3[4],P3[3]}};
}
// Return the control points for a subpatch of P on [0,u] x [0,v].
-triple[][] subpatchend(triple[][] P, real u, real v)
+triple[][] subpatchbegin(triple[][] P, real u, real v)
{
triple[] P0=P[0];
triple[] P1=P[1];
@@ -1030,28 +1082,31 @@ triple[][] subpatchend(triple[][] P, real u, real v)
triple[] c2=split(P2[0],P2[1],P2[2],P2[3],v);
triple[] c3=split(P3[0],P3[1],P3[2],P3[3],v);
- u=1.0-u;
-
- triple[] c4=split(P3[0],P2[0],P1[0],P0[0],u);
- triple[] c5=split(c3[0],c2[0],c1[0],c0[0],u);
- triple[] c6=split(c3[1],c2[1],c1[1],c0[1],u);
- triple[] c7=split(c3[2],c2[2],c1[2],c0[2],u);
+ triple[] c4=split(P0[0],P1[0],P2[0],P3[0],u);
+ triple[] c5=split(c0[0],c1[0],c2[0],c3[0],u);
+ triple[] c6=split(c0[1],c1[1],c2[1],c3[1],u);
+ triple[] c7=split(c0[2],c1[2],c2[2],c3[2],u);
return new triple[][] {
{P0[0],c0[0],c0[1],c0[2]},
- {c4[4],c5[4],c6[4],c7[4]},
- {c4[3],c5[3],c6[3],c7[3]},
+ {c4[0],c5[0],c6[0],c7[0]},
+ {c4[1],c5[1],c6[1],c7[1]},
{c4[2],c5[2],c6[2],c7[2]}};
}
+triple[][] subpatch(triple[][] P, pair a, pair b)
+{
+ return subpatchend(subpatchbegin(P,b.x,b.y),a.x/b.x,a.y/b.y);
+}
+
patch subpatch(patch s, pair a, pair b)
{
assert(a.x >= 0 && a.y >= 0 && b.x <= 1 && b.y <= 1 &&
a.x < b.x && a.y < b.y);
- return patch(subpatchbegin(subpatchend(s.P,b.x,b.y),a.x/b.x,a.y/b.y),
- s.straight,s.planar);
+ return patch(subpatch(s.P,a,b),s.straight,s.planar);
}
+
// return an array containing all intersection times of path p and patch s.
real[][] intersections(path3 p, patch s, real fuzz=-1)
{
@@ -1216,7 +1271,8 @@ void draw(transform t=identity(), frame f, surface s, int nu=1, int nv=1,
light light=currentlight, light meshlight=light, string name="",
render render=defaultrender, projection P=currentprojection)
{
- if(is3D()) {
+ bool is3D=is3D();
+ if(is3D) {
begingroup3(f,name == "" ? "surface" : name,render);
for(int i=0; i < s.s.length; ++i)
draw3D(f,s.s[i],surfacepen[i],light);
@@ -1238,7 +1294,8 @@ void draw(transform t=identity(), frame f, surface s, int nu=1, int nv=1,
endgroup3(f);
}
}
- } else {
+ }
+ if(!is3D || settings.render == 0) {
begingroup(f);
// Sort patches by mean distance from camera
triple camera=P.camera;
@@ -1299,11 +1356,10 @@ void draw(picture pic=currentpicture, surface s, int nu=1, int nv=1,
surface S=t*s;
if(is3D())
draw(f,S,nu,nv,surfacepen,meshpen,light,meshlight,name,render);
- else if(pic != null)
+ if(pic != null) {
pic.add(new void(frame f, transform T) {
draw(T,f,S,nu,nv,surfacepen,meshpen,light,meshlight,P);
},true);
- if(pic != null) {
pic.addPoint(min(S,P));
pic.addPoint(max(S,P));
}
@@ -1941,52 +1997,3 @@ void draw(picture pic=currentpicture, triple[][] P, real[] uknot, real[] vknot,
},true);
pic.addBox(minbound(P),maxbound(P));
}
-
-// A structure to subdivide two intersecting patches about their intersection.
-struct split
-{
- // Container for subpatches of p.
- triple[][][] T;
-
- struct tree {
- tree[] tree=new tree[2];
- }
- // Default subdivision depth.
- int n=23;
-
- // Subdivide p and q to depth n if they overlap.
- void write(tree t, triple[][] p, triple[][] q, int depth=n) {
- --depth;
- triple[][][] split(triple[][] P)=depth % 2 == 0 ? hsplit : vsplit;
- triple[][][] P=split(p);
- triple[][][] Q=split(q);
-
- for(int i=0; i < 2; ++i) {
- for(int j=0; j < 2; ++j) {
- if(overlap(P[i],Q[j])) {
- if(!t.tree.initialized(i)) t.tree[i]=new tree;
- if(depth > 0) write(t.tree[i],P[i],Q[j],depth);
- }
- }
- }
- }
-
- // Output the subpatches of p from subdivision.
- void read(tree t, triple[][] p, int depth=n) {
- --depth;
- triple[][][] split(triple[][] P)=depth % 2 == 0 ? hsplit : vsplit;
- triple[][][] P=split(p);
-
- for(int i=0; i < 2; ++i) {
- if(t.tree.initialized(i))
- read(t.tree[i],P[i],depth);
- else T.push(P[i]);
- }
- }
-
- void operator init(triple[][] p, triple[][] q, int depth=n) {
- tree trunk;
- write(trunk,p,q,depth);
- read(trunk,p,depth);
- }
-}
diff --git a/Master/texmf/asymptote/version.asy b/Master/texmf/asymptote/version.asy
index f824ed08dec..2912aa57db5 100644
--- a/Master/texmf/asymptote/version.asy
+++ b/Master/texmf/asymptote/version.asy
@@ -1 +1 @@
-string VERSION="2.13";
+string VERSION="2.16";
diff --git a/Master/texmf/doc/asymptote/CAD.pdf b/Master/texmf/doc/asymptote/CAD.pdf
index af88c9c9895..bb61b12dd4d 100644
--- a/Master/texmf/doc/asymptote/CAD.pdf
+++ b/Master/texmf/doc/asymptote/CAD.pdf
Binary files differ
diff --git a/Master/texmf/doc/asymptote/TeXShopAndAsymptote.pdf b/Master/texmf/doc/asymptote/TeXShopAndAsymptote.pdf
index 669f1660b2f..61dfa38cc71 100644
--- a/Master/texmf/doc/asymptote/TeXShopAndAsymptote.pdf
+++ b/Master/texmf/doc/asymptote/TeXShopAndAsymptote.pdf
Binary files differ
diff --git a/Master/texmf/doc/asymptote/asy-latex.pdf b/Master/texmf/doc/asymptote/asy-latex.pdf
index c028d584dd5..55883f461c8 100644
--- a/Master/texmf/doc/asymptote/asy-latex.pdf
+++ b/Master/texmf/doc/asymptote/asy-latex.pdf
Binary files differ
diff --git a/Master/texmf/doc/asymptote/asyRefCard.pdf b/Master/texmf/doc/asymptote/asyRefCard.pdf
new file mode 100644
index 00000000000..bed262c88fd
--- /dev/null
+++ b/Master/texmf/doc/asymptote/asyRefCard.pdf
Binary files differ
diff --git a/Master/texmf/doc/asymptote/asymptote.pdf b/Master/texmf/doc/asymptote/asymptote.pdf
index 03e6987937e..914215456fb 100644
--- a/Master/texmf/doc/asymptote/asymptote.pdf
+++ b/Master/texmf/doc/asymptote/asymptote.pdf
Binary files differ
diff --git a/Master/texmf/doc/asymptote/examples/animations/earthmoon.asy b/Master/texmf/doc/asymptote/examples/animations/earthmoon.asy
index 08c578d86d2..efca043b8bc 100644
--- a/Master/texmf/doc/asymptote/examples/animations/earthmoon.asy
+++ b/Master/texmf/doc/asymptote/examples/animations/earthmoon.asy
@@ -62,7 +62,7 @@ draw(pic,shift(cst,0,0)*scale3(Rtl/2)*unitsphere,yellow);
surface terre=scale3(Rtl/5)*unitsphere;
surface lune=scale3(Rl)*unitsphere;
-int n=100;
+int n=50;
real step=2pi/n;
for(int i=0; i < n; ++i) {
diff --git a/Master/texmf/doc/asymptote/examples/animations/sphere.asy b/Master/texmf/doc/asymptote/examples/animations/sphere.asy
index 56c5f73e3b6..125cecc5566 100644
--- a/Master/texmf/doc/asymptote/examples/animations/sphere.asy
+++ b/Master/texmf/doc/asymptote/examples/animations/sphere.asy
@@ -22,11 +22,7 @@ for(int i=0; i < nbpts; ++i) {
transform3 t=rotate(angle,(0,0,0),(1,0.25,0.25));
revolution r=sphere(O,3);
draw(surface(r),lightgrey);
-skeleton s;
-r.transverse(s,reltime(r.g,0.5));
-r.longitudinal(s);
-draw(s.transverse.back,linetype("8 8",8));
-draw(s.transverse.front);
+draw(r,backpen=linetype("8 8",8));
animation A;
diff --git a/Master/texmf/doc/asymptote/examples/animations/wheel.asy b/Master/texmf/doc/asymptote/examples/animations/wheel.asy
index 2ea45f75613..6620d590850 100644
--- a/Master/texmf/doc/asymptote/examples/animations/wheel.asy
+++ b/Master/texmf/doc/asymptote/examples/animations/wheel.asy
@@ -1,4 +1,9 @@
import graph;
+
+// Uncomment the following 2 lines to support pdf animations:
+// usepackage("animate");
+// settings.tex="pdflatex";
+
import animation;
size(0,200);
@@ -24,6 +29,8 @@ guide wheel(guide g=nullpath, real a, real b, int n)
real t1=0;
real t2=t1+2*pi;
+animation a;
+
draw(circle((0,0),1));
draw(wheel(t1,t2,100),linetype("0 2"));
yequals(Label("$y=-1$",1.0),-1,extend=true,linetype("4 4"));
@@ -34,8 +41,6 @@ pair z2=wheelpoint(t2);
dot(z1);
dot(z2);
-animation a;
-
int n=10;
real dt=(t2-t1)/n;
for(int i=0; i <= n; ++i) {
@@ -49,5 +54,10 @@ for(int i=0; i <= n; ++i) {
restore();
}
-// Produce the final merged gif.
+erase();
+
+// Merge the images into a gif animation.
a.movie(BBox(0.25cm),loops=10,delay=250);
+
+// Merge the images into a pdf animation.
+// label(a.pdf(BBox(0.25cm),delay=250,"controls",multipage=false));
diff --git a/Master/texmf/doc/asymptote/examples/electromagnetic.asy b/Master/texmf/doc/asymptote/examples/electromagnetic.asy
index 058c7c5c574..d229f76b748 100644
--- a/Master/texmf/doc/asymptote/examples/electromagnetic.asy
+++ b/Master/texmf/doc/asymptote/examples/electromagnetic.asy
@@ -33,15 +33,15 @@ picture q=secondaryX(new void(picture p) {
scale(p,LogLeft,Linear);
xlimits(p,lambda(fmax),lambda(fmin));
ylimits(p,0,1);
- xaxis(p,Label("\nano\metre",1),Top,LeftTicks(DefaultLogFormat,n=10));
+ xaxis(p,Label("\nano\metre",1,0.01N),Top,LeftTicks(DefaultLogFormat,n=10));
});
add(q,above=true);
margin margin=PenMargin(0,0);
-draw("radio",Scale((10,1))--Scale((5e12,1)),N,Arrow);
-draw("infrared",Scale((1e12,1.5))--Scale(shift(0,1.5)*ir),Arrows,margin);
-draw("UV",Scale(shift(0,1.5)*uv)--Scale((1e17,1.5)),Arrows,margin);
-draw("x-rays",Scale((1e16,1))--Scale((1e21,1)),N,Arrows);
-draw("$\gamma$-rays",Scale((fmax,1.5))--Scale((2e18,1.5)),Arrow);
+draw("radio",Scale((10,1))--Scale((5e12,1)),S,Arrow);
+draw("infrared",Scale((1e12,1.75))--Scale(shift(0,1.75)*ir),LeftSide,Arrows,margin);
+draw("UV",Scale(shift(0,1.75)*uv)--Scale((1e17,1.76)),LeftSide,Arrows,margin);
+draw("x-rays",Scale((1e16,1))--Scale((1e21,1)),RightSide,Arrows);
+draw("$\gamma$-rays",Scale((fmax,1.75))--Scale((2e18,1.75)),Arrow);
diff --git a/Master/texmf/doc/asymptote/examples/hyperboloid.asy b/Master/texmf/doc/asymptote/examples/hyperboloid.asy
index 0cf6da08c40..22f3b3d80b0 100644
--- a/Master/texmf/doc/asymptote/examples/hyperboloid.asy
+++ b/Master/texmf/doc/asymptote/examples/hyperboloid.asy
@@ -2,7 +2,7 @@ size(200);
import solids;
currentprojection=perspective(4,4,3);
-revolution hyperboloid=revolution(new real(real x) {return sqrt(1+x*x);},
- -2,2,20,operator..,X);
+revolution hyperboloid=revolution(graph(new triple(real z) {
+ return (sqrt(1+z*z),0,z);},-2,2,20,operator ..),axis=Z);
draw(surface(hyperboloid),green,render(compression=Low,merge=true));
draw(hyperboloid,6,blue,longitudinalpen=nullpen);
diff --git a/Master/texmf/doc/asymptote/examples/hyperboloidsilhouette.asy b/Master/texmf/doc/asymptote/examples/hyperboloidsilhouette.asy
index 1187208a670..1bb265de622 100644
--- a/Master/texmf/doc/asymptote/examples/hyperboloidsilhouette.asy
+++ b/Master/texmf/doc/asymptote/examples/hyperboloidsilhouette.asy
@@ -4,6 +4,6 @@ settings.render=0;
settings.prc=false;
currentprojection=perspective(4,4,3);
-revolution hyperboloid=revolution(new real(real x) {return sqrt(1+x*x);},
- -2,2,20,operator..,X);
+revolution hyperboloid=revolution(graph(new triple(real z) {
+ return (sqrt(1+z*z),0,z);},-2,2,20,operator ..),axis=Z);
draw(hyperboloid.silhouette(64),blue);
diff --git a/Master/texmf/doc/asymptote/examples/latexusage.tex b/Master/texmf/doc/asymptote/examples/latexusage.tex
index f3c858348b9..910cef5bf10 100644
--- a/Master/texmf/doc/asymptote/examples/latexusage.tex
+++ b/Master/texmf/doc/asymptote/examples/latexusage.tex
@@ -84,7 +84,7 @@ renderer. To support {\tt latexmk}, 3D figures should specify
attachments; this requires the \verb+attach=true+ option as well as the
\verb+attachfile2+ \LaTeX\ package.
\begin{center}
-\begin{asy}[height=4cm,inline=true,attach=false]
+\begin{asy}[height=4cm,inline=true,attach=false,viewportwidth=\linewidth]
currentprojection=orthographic(5,4,2);
draw(unitcube,blue);
label("$V-E+F=2$",(0,1,0.5),3Y,blue+fontsize(17pt));
diff --git a/Master/texmf/doc/asymptote/examples/pseudosphere.asy b/Master/texmf/doc/asymptote/examples/pseudosphere.asy
new file mode 100644
index 00000000000..a740381ef0e
--- /dev/null
+++ b/Master/texmf/doc/asymptote/examples/pseudosphere.asy
@@ -0,0 +1,33 @@
+// Pseudosphere:
+// x = a sin(u) cos(v);
+// y = a sin(u) sin(v);
+// z = a (ln(tg(u/2))+cos(u));
+
+import three;
+import solids;
+import graph3;
+import palette;
+
+triple pseudosphere(real x) {
+ return (sin(x),0,cos(x)+log(tan(x/2)));
+}
+
+size(20cm,IgnoreAspect);
+currentprojection=orthographic(160,40,100);
+currentlight=(50,50,50);
+
+path3 G=graph(pseudosphere,0.5pi,0.965pi,10,Spline);
+
+revolution r=revolution(O,G,Z);
+
+draw(r,1,longitudinalpen=nullpen);
+surface s=surface(r);
+s.colors(palette(s.map(zpart),Gradient(cyan+white+opacity(0.9),
+ magenta+white+opacity(0.9))));
+draw(s);
+
+draw(r,6,backpen=linetype("10 10",10),longitudinalpen=nullpen);
+
+int n=10;
+for(int i=0; i < n; ++i)
+ draw(rotate(i*360/n,O,Z)*G);
diff --git a/Master/texmf/doc/asymptote/examples/ring.asy b/Master/texmf/doc/asymptote/examples/ring.asy
index 6963d42d23f..5fec60d4c0b 100644
--- a/Master/texmf/doc/asymptote/examples/ring.asy
+++ b/Master/texmf/doc/asymptote/examples/ring.asy
@@ -1,5 +1,4 @@
size(0,100);
-path unitcircle=E..N..W..S..cycle;
path g=scale(2)*unitcircle;
label("$a \le r \le b$");
radialshade(unitcircle^^g,yellow+evenodd,(0,0),1.0,yellow+brown,(0,0),2);
diff --git a/Master/texmf/doc/asymptote/examples/splitpatch.asy b/Master/texmf/doc/asymptote/examples/splitpatch.asy
index f1f5b6b98ba..2e9fae66431 100644
--- a/Master/texmf/doc/asymptote/examples/splitpatch.asy
+++ b/Master/texmf/doc/asymptote/examples/splitpatch.asy
@@ -2,6 +2,64 @@ import three;
size(300);
+// A structure to subdivide two intersecting patches about their intersection.
+struct split
+{
+ surface[] S=sequence(new surface(int i) {return new surface;},1);
+ surface[] T=sequence(new surface(int i) {return new surface;},1);
+
+ struct tree {
+ tree[] tree=new tree[2];
+ }
+ // Default subdivision depth.
+ int n=20;
+
+ // Subdivide p and q to depth n if they overlap.
+ void write(tree pt, tree qt, triple[][] p, triple[][] q, int depth=n) {
+ --depth;
+ triple[][][] Split(triple[][] P)=depth % 2 == 0 ? hsplit : vsplit;
+ triple[][][] P=Split(p);
+ triple[][][] Q=Split(q);
+
+ for(int i=0; i < 2; ++i) {
+ triple[][] Pi=P[i];
+ for(int j=0; j < 2; ++j) {
+ triple[][] Qj=Q[j];
+ if(overlap(Pi,Qj)) {
+ if(!pt.tree.initialized(i))
+ pt.tree[i]=new tree;
+ if(!qt.tree.initialized(j))
+ qt.tree[j]=new tree;
+ if(depth > 0)
+ write(pt.tree[i],qt.tree[j],Pi,Qj,depth);
+ }
+ }
+ }
+ }
+
+ // Output the subpatches of p from subdivision.
+ void read(surface[] S, tree t, triple[][] p, int depth=n) {
+ --depth;
+ triple[][][] Split(triple[][] P)=depth % 2 == 0 ? hsplit : vsplit;
+ triple[][][] P=Split(p);
+
+ for(int i=0; i < 2; ++i) {
+ if(t.tree.initialized(i))
+ read(S,t.tree[i],P[i],depth);
+ else {
+ S[0].push(patch(P[i]));
+ }
+ }
+ }
+
+ void operator init(triple[][] p, triple[][] q, int depth=n) {
+ tree ptrunk,qtrunk;
+ write(ptrunk,qtrunk,p,q,depth);
+ read(T,ptrunk,p,depth);
+ read(S,qtrunk,q,depth);
+ }
+}
+
currentprojection=orthographic(0,0,1);
triple[][] A={
@@ -18,11 +76,12 @@ triple[][] B={
{(0.5,0,2),(0.5,1,2),(0.5,2,2),(0.5,3,2)}
};
-split S=split(A,B,10);
-//write(S.T.length);
+split S=split(B,A);
defaultrender.merge=true;
-for(int i=0; i < S.T.length; ++i)
- draw(surface(patch(S.T[i])),Pen(i));
-draw(surface(patch(B)),blue);
+for(int i=0; i < S.S[0].s.length; ++i)
+ draw(surface(S.S[0].s[i]),Pen(i));
+
+for(int i=0; i < S.T[0].s.length; ++i)
+ draw(surface(S.T[0].s[i]),Pen(i));
diff --git a/Master/texmf/doc/info/asy-faq.info b/Master/texmf/doc/info/asy-faq.info
index 379b772757c..ce35b88fc2b 100644
--- a/Master/texmf/doc/info/asy-faq.info
+++ b/Master/texmf/doc/info/asy-faq.info
@@ -10,7 +10,7 @@ END-INFO-DIR-ENTRY
File: asy-faq.info, Node: Top, Next: Question 1.1, Up: (dir)
ASYMPTOTE FREQUENTLY ASKED QUESTIONS
- 19 Jun 2011
+ 30 May 2012
This is the list of Frequently Asked Questions about Asymptote (asy).
diff --git a/Master/texmf/doc/info/asymptote.info b/Master/texmf/doc/info/asymptote.info
index 3bc2bee2a7f..ee7d4f40b51 100644
--- a/Master/texmf/doc/info/asymptote.info
+++ b/Master/texmf/doc/info/asymptote.info
@@ -1,7 +1,7 @@
This is asymptote.info, produced by makeinfo version 4.13 from
../asymptote.texi.
-This file documents `Asymptote', version 2.13.
+This file documents `Asymptote', version 2.16.
`http://asymptote.sourceforge.net'
@@ -23,7 +23,7 @@ File: asymptote.info, Node: Top, Next: Description, Up: (dir)
Asymptote
*********
-This file documents `Asymptote', version 2.13.
+This file documents `Asymptote', version 2.16.
`http://asymptote.sourceforge.net'
@@ -237,6 +237,9 @@ output, including animations, are available at
`Asymptote' tutorial can be found at
`http://asymptote.sourceforge.net/links.html'.
+ A quick reference card for `Asymptote' is available at
+
+ `http://asymptote.sourceforge.net/asyRefCard.pdf'.

File: asymptote.info, Node: Installation, Next: Tutorial, Prev: Description, Up: Top
@@ -471,7 +474,8 @@ following paths, in the order listed:
1. The current directory;
2. A list of one or more directories specified by the configuration
- variable `dir' (separated by `:' under UNIX and `;' under `MSDOS');
+ variable `dir' or environment variable `ASYMPTOTE_DIR' (separated
+ by `:' under UNIX and `;' under `MSDOS');
3. The directory specified by the environment variable
`ASYMPTOTE_HOME'; if this variable is not set, the directory
@@ -495,14 +499,14 @@ tar -xf asymptote-x.xx.src.tar
cd asymptote-x.xx
By default the system version of the Boehm garbage collector will be
used; if it is old we recommend first putting
-`http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.1.tar.gz'
+`http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.2b.tar.gz'
in the `Asymptote' source directory.
If your graphics card supports multisampling, we recommend using version
-`2.6.0' (or later) of `freeglut' to support antialiasing in
-`Asymptote''s adaptive `OpenGL' 3D renderer (`MacOS X' users can skip
-this step since `Asymptote' is configured to use the native glut
-library on that platform). Download
+`2.6.0' of `freeglut' to support antialiasing in `Asymptote''s adaptive
+`OpenGL' 3D renderer (`MacOS X' users can skip this step since
+`Asymptote' is configured to use the native glut library on that
+platform). Download
`http://prdownloads.sourceforge.net/freeglut/freeglut-2.6.0.tar.gz'
and type (as the root user):
@@ -1108,17 +1112,15 @@ File: asymptote.info, Node: label, Prev: clip, Up: Drawing commands
=========
void label(picture pic=currentpicture, Label L, pair position,
- align align=NoAlign, pen p=nullpen, filltype filltype=NoFill)
+ align align=NoAlign, pen p=currentpen, filltype filltype=NoFill)
Draw Label `L' on picture `pic' using pen `p'. If `align' is `NoAlign',
the label will be centered at user coordinate `position'; otherwise it
will be aligned in the direction of `align' and displaced from
`position' by the `PostScript' offset `align*labelmargin(p)'. The
constant `Align' can be used to align the bottom-left corner of the
-label at `position'. If `p' is `nullpen', the pen specified within the
-Label, which defaults to `currentpen', will be used. The Label `L' can
-either be a string or the structure obtained by calling one of the
-functions
+label at `position'. The Label `L' can either be a string or the
+structure obtained by calling one of the functions
Label Label(string s="", pair position, align align=NoAlign,
pen p=nullpen, embed embed=Rotate, filltype filltype=NoFill);
Label Label(string s="", align align=NoAlign,
@@ -1132,8 +1134,9 @@ multiplying it on the left by an affine transform (*note Transforms::).
For example, `rotate(45)*xscale(2)*L' first scales `L' in the x
direction and then rotates it counterclockwise by 45 degrees. The final
position of a Label can also be shifted by a `PostScript' coordinate
-translation: `shift(10,0)*L'. The `embed' argument determines how the
-Label should transform with the embedding picture:
+translation: `shift(10,0)*L'. An explicit pen specified within the
+Label overrides other pen arguments. The `embed' argument determines
+how the Label should transform with the embedding picture:
`Shift'
only shift with embedding picture;
@@ -1152,7 +1155,7 @@ Label should transform with the embedding picture:
To add a label to a path, use
void label(picture pic=currentpicture, Label L, path g, align align=NoAlign,
- pen p=nullpen, filltype filltype=NoFill);
+ pen p=currentpen, filltype filltype=NoFill);
By default the label will be positioned at the midpoint of the path.
An alternative label position (in the sense of `point(path p, real t)')
may be specified as a real value for `position' in constructing the
@@ -1425,7 +1428,9 @@ user-defined types):
for reals is `0.0'. Real numbers have precision `realEpsilon',
with `realDigits' significant digits. The smallest positive real
number is `realMin' and the largest positive real number is
- `realMax'.
+ `realMax'. The variable `inf' and function `bool isnan(real x)'
+ are useful when floating-point exceptions are masked with the
+ `-mask' command-line option (the default in interactive mode).
`pair'
complex number, that is, an ordered pair of real components
@@ -1653,11 +1658,12 @@ user-defined types):
substrings delimited by `delimiter' (an empty delimiter
signifies a space, but with duplicate delimiters discarded);
- `string format(string s, int n)'
+ `string format(string s, int n, string locale="")'
returns a string containing `n' formatted according to the
- C-style format string `s' using the current locale;
+ C-style format string `s' using locale `locale' (or the
+ current locale if an empty string is specified);
- `string format(string s=defaultformat, real x, string locale="")'
+ `string format(string s=defaultformat, string s=defaultseparator, real x, string locale="")'
returns a string containing `x' formatted according to the
C-style format string `s' using locale `locale' (or the
current locale if an empty string is specified), following
@@ -1665,10 +1671,13 @@ user-defined types):
one data field is allowed, trailing zeros are removed by
default (unless `#' is specified), and (if the format string
specifies math mode) TeX is used to typeset scientific
- notation;
+ notation using the `defaultseparator="\!\times\!";';
`int hex(string s);'
- casts a hexidecimal string `s' to an integer.
+ casts a hexidecimal string `s' to an integer;
+
+ `int ascii(string s);'
+ returns the ASCII code for the first character of string `s';
`string string(real x, int digits=realDigits)'
casts `x' to a string using precision `digits' and the C
@@ -1676,7 +1685,7 @@ user-defined types):
`string locale(string s="")'
sets the locale to the given string, if nonempty, and returns
- the current locale.
+ the current locale;
`string time(string format="%a %b %d %T %Z %Y")'
returns the current time formatted by the ANSI C routine
@@ -1709,6 +1718,17 @@ user-defined types):
current locale. For example, to return the date corresponding
to 24 hours ago: time(seconds()-24*60*60);
+ `int system(string s)'
+
+ `int system(string[] s)'
+ if the setting `safe' is false, call the arbitrary system
+ command `s';
+
+ `void asy(string format, bool overwrite=false ... string[] s)'
+ conditionally process each file name in array `s' in a new
+ environment, using format `format', overwriting the output
+ file only if `overwrite' is true;
+
`void abort(string s="")'
aborts execution (with a non-zero return code in batch mode);
if string `s' is nonempty, a diagnostic message constructed
@@ -1847,8 +1867,8 @@ File: asymptote.info, Node: Paths and guides, Next: Pens, Prev: Data types,
`pair dir(path p)'
returns dir(p,length(p)).
- `pair dir(path p, path g)'
- returns unit(dir(p)+dir(g)).
+ `pair dir(path p, path q)'
+ returns unit(dir(p)+dir(q)).
`pair accel(path p, int t, int sign=0);'
If `sign < 0', return the acceleration of the incoming path
@@ -1887,6 +1907,9 @@ File: asymptote.info, Node: Paths and guides, Next: Pens, Prev: Data types,
at which the cumulative arclength (measured from the
beginning of the path) equals `L'.
+ `real arcpoint(path p, real L);'
+ returns `point(p,arctime(p,L))'.
+
`real dirtime(path p, pair z);'
returns the first "time", a real number between 0 and the
length of the path in the sense of `point(path, real)', at
@@ -2250,8 +2273,8 @@ number, until it saturates with one or more color components equal to 1.
pen longdashed=linetype(new real[] {24,8});
pen dashdotted=linetype(new real[] {8,8,0,8});
pen longdashdotted=linetype(new real[] {24,8,0,8});
- pen Dotted=dotted+1.0;
- pen Dotted(pen p=currentpen) {return dotted+2*linewidth(p);}
+ pen Dotted(pen p=currentpen) {return linetype(new real[] {0,3})+2*linewidth(p);}
+ pen Dotted=Dotted();
@@ -2264,9 +2287,9 @@ number, until it saturates with one or more color components equal to 1.
linewidth(real)'. The default line width is 0.5 bp; this value may
be changed with `defaultpen(pen)'. The line width of a pen is
returned by `real linewidth(pen p=currentpen)'. For convenience,
- in the module `plain' we define static void defaultpen(real w) {defaultpen(linewidth(w));}
- static pen operator +(pen p, real w) {return p+linewidth(w);}
- static pen operator +(real w, pen p) {return linewidth(w)+p;}
+ in the module `plain_pens' we define void defaultpen(real w) {defaultpen(linewidth(w));}
+ pen operator +(pen p, real w) {return p+linewidth(w);}
+ pen operator +(real w, pen p) {return linewidth(w)+p;}
so that one may set the line width like this: defaultpen(2);
pen p=red+0.5;
@@ -2862,8 +2885,9 @@ File: asymptote.info, Node: Files, Next: Variable initializers, Prev: Frames
value) files and portable XDR (External Data Representation) binary
files.
- An input file must first be opened with `input(string name, bool
-check=true, string comment="#")'; reading is then done by assignment:
+ An input file must first be opened with
+input(string name="", bool check=true, string comment="#", string mode="");
+ reading is then done by assignment:
file fin=input("test.txt");
real a=fin;
@@ -2888,7 +2912,7 @@ including a newline. In addition, `Asymptote' provides the function
character as an ordinary character) and return it as a string.
A file named `name' can be open for output with
-file output(string name, bool update=false);
+file output(string name="", bool update=false, string comment="#", string mode="");
If `update=false', any existing data in the file will be erased and
only write operations can be used on the file. If `update=true', any
existing data will be preserved, the position will be set to the
@@ -2926,19 +2950,18 @@ file fout=output("test.txt");
write(fout,1); // Writes "1"
write(fout); // Writes a new line
write(fout,"List: ",1,2,3); // Writes "List: 1 2 3"
- A file may also be opened with `xinput' or `xoutput', instead of
-`input' or `output', to read or write double precision (64-bit) reals
-and single precision (32-bit) integers in Sun Microsystem's XDR
-(External Data Representation) portable binary format (available on all
-`UNIX' platforms). Alternatively, a file may also be opened with
-`binput' or `boutput' to read or write double precision reals and single
-precision integers in the native (nonportable) machine binary format.
-The virtual member functions `file singlereal(bool b=true)' and `file
-singleint(bool b=true)' be used to change the precision of real and
-integer I/O operations, respectively, for an XDR or binary file `f'.
-Similarly, the function `file signedint(bool b=true)' can be used to
-modify the signedness of integer reads and writes for an XDR or binary
-file `f'.
+ A file may be opened with `mode="xdr"', to read or write double
+precision (64-bit) reals and single precision (32-bit) integers in Sun
+Microsystem's XDR (External Data Representation) portable binary format
+(available on all `UNIX' platforms). Alternatively, a file may also be
+opened with `mode="binary"' to read or write double precision reals and
+single precision integers in the native (nonportable) machine binary
+format. The virtual member functions `file singlereal(bool b=true)'
+and `file singleint(bool b=true)' be used to change the precision of
+real and integer I/O operations, respectively, for an XDR or binary
+file `f'. Similarly, the function `file signedint(bool b=true)' can be
+used to modify the signedness of integer reads and writes for an XDR or
+binary file `f'.
The virtual members `name', `mode', `singlereal', `singleint', and
`signedint' may be used to query the respective parameters for a given
@@ -3011,9 +3034,7 @@ int convert(string args="", string file="", string format="");
int animate(string args="", string file="", string format="");
call the `ImageMagick' commands `convert' and `animate', respectively,
with the arguments `args' and the file name constructed from the
-strings `file' and `format'. If the setting `safe' is false, then the
-functions `int system(string s)' and `int system(string[] s)' can be
-used to call the arbitrary system command `s'.
+strings `file' and `format'.

File: asymptote.info, Node: Variable initializers, Next: Structures, Prev: Files, Up: Programming
@@ -3398,7 +3419,7 @@ the type of the result:
not
`Asymptote' also supports the C-like conditional syntax:
-bool positive=(pi >= 0) ? true : false;
+bool positive=(pi > 0) ? true : false;
The function `T interp(T a, T b, real t)' returns `(1-t)*a+t*b' for
nonintegral built-in arithmetic types `T'. If `a' and `b' are pens,
@@ -3831,8 +3852,9 @@ module `gsl' that defines the airy functions `Ai(real)', `Bi(real)',
`i_scaled(int, real)', `k_scaled(int, real)', `J(real, real)', `Y(real,
real)', `I(real, real)', `K(real, real)', `zero_J(real, int)', the
elliptic functions `F(real, real)', `E(real, real)', and `P(real,
-real)', the exponential/trigonometric integrals `Ei', `Si', and `Ci',
-the Legendre polynomials `Pl(int, real)', and the Riemann zeta function
+real)', the Jacobi elliptic functions `real[] sndncn(real,real)', the
+exponential/trigonometric integrals `Ei', `Si', and `Ci', the Legendre
+polynomials `Pl(int, real)', and the Riemann zeta function
`zeta(real)'. For example, to compute the sine integral `Si' of 1.0:
import gsl;
write(Si(1.0));
@@ -4035,17 +4057,11 @@ of type `T[]'.
`i' precedes element `j' if `less(i,j)' is true;
`T[] copy(T[] a)'
- returns a copy of the array `a';
-
-`T[][] copy(T[][] a)'
- returns a copy of the array `a';
-
-`T[][][] copy(T[][][] a)'
- returns a copy of the array `a';
+ returns a deep copy of the array `a';
`T[] concat(... T[][] a)'
- returns a new array formed by concatenating the arrays given as
- arguments;
+ returns a new array formed by concatenating the given
+ one-dimensional arrays given as arguments;
`bool alias(T[] a, T[] b)'
returns `true' if the arrays `a' and `b' are identical;
@@ -4535,8 +4551,9 @@ code s=quote {
};
eval(s,true); // Outputs 1
- To include the contents of a file `graph' verbatim (as if the
-contents of the file were inserted at that point), use one of the forms:
+ To include the contents of an existing file `graph' verbatim (as if
+the contents of the file were inserted at that point), use one of the
+forms:
include graph;
`include "/usr/local/share/asymptote/graph.asy";'
@@ -4672,7 +4689,8 @@ for each figure. Simply add the line `\usepackage{asymptote}' at the
beginning of your file and enclose your `Asymptote' code within a
`\begin{asy}...\end{asy}' environment. As with the `LaTeX' `comment'
environment, the `\end{asy}' command must appear on a line by itself,
-with no trailing commands/comments.
+with no trailing commands/comments. A blank line is not allowed after
+`\begin{asy}'.
The sample `LaTeX' file below, named `latexusage.tex', can be run as
follows:
@@ -4691,18 +4709,19 @@ pdflatex latexusage
`Asymptote' code is to use the `latexmk' utility from
`http://www.ctan.org/tex-archive/support/latexmk/'
- after putting the rules
-
-sub asy {return system("asy '$_[0]'");}
-add_cus_dep("asy","eps",0,"asy");
-add_cus_dep("asy","pdf",0,"asy");
-add_cus_dep("asy","tex",0,"asy");
+ after putting the contents of
+`http://asymptote.svn.sourceforge.net/viewvc/asymptote/trunk/asymptote/doc/latexmkrc'
in a file `latexmkrc' in the same directory. The command
latexmk -pdf latexusage
will then call `Asymptote' automatically, recompiling only the figures
that have changed. Since each figure is compiled in a separate system
-process, this method also tends to use less memory. External
-`Asymptote' code in `filename.asy' should be included with
+process, this method also tends to use less memory. To store the
+figures in a separate directory named `asy', one can define
+\def\asydir{asy}
+ in `latexusage.tex' and put the contents of
+`http://asymptote.svn.sourceforge.net/viewvc/asymptote/trunk/asymptote/doc/latexmkrc_asydir'
+in a file `latexmkrc' in the same directory. External `Asymptote' code
+in `filename.asy' should be included with
\asyinclude[<options>]{<filename.asy>}
so that `latexmk' will recognize when the code is changed. Note that
`latemk' requires `perl', available from `http://www.perl.org/'.
@@ -4712,10 +4731,9 @@ process, this method also tends to use less memory. External
the `asy' and `asyinclude' environments. Three-dimensional PRC files
may either be embedded within the page (the default) or attached as
annotated (but printable) attachments, using the `attach' option and
-the `attachfile2' (or older `attachfile') `LaTeX' package. The default
-value of `viewportwidth' is `\the\linewidth' for inline 3D figures and
-`0' for attachments. The `inline' option generates inline `LaTeX' code
-instead of EPS or PDF files. This makes 2D LaTeX symbols visible to the
+the `attachfile2' (or older `attachfile') `LaTeX' package. The
+`inline' option generates inline `LaTeX' code instead of EPS or PDF
+files. This makes 2D LaTeX symbols visible to the
`\begin{asy}...\end{asy}' environment. In this mode, Asymptote
correctly aligns 2D LaTeX symbols defined outside of
`\begin{asy}...\end{asy}', but treats their size as zero; an optional
@@ -4817,7 +4835,7 @@ renderer. To support {\tt latexmk}, 3D figures should specify
attachments; this requires the \verb+attach=true+ option as well as the
\verb+attachfile2+ \LaTeX\ package.
\begin{center}
-\begin{asy}[height=4cm,inline=true,attach=false]
+\begin{asy}[height=4cm,inline=true,attach=false,viewportwidth=\linewidth]
currentprojection=orthographic(5,4,2);
draw(unitcube,blue);
label("$V-E+F=2$",(0,1,0.5),3Y,blue+fontsize(17pt));
@@ -5182,7 +5200,7 @@ File: asymptote.info, Node: animation, Next: embed, Prev: roundedpath, Up: B
================
This module allows one to generate animations, as illustrated by the
-files `wheel.asy', `wavelet.asy', and `cube.asy' in the `animations'
+files `wheel.asy', `wavepacket.asy', and `cube.asy' in the `animations'
subdirectory of the examples directory. These animations use the
`ImageMagick' `convert' program to merge multiple images into a GIF or
MPEG movie.
@@ -5734,17 +5752,17 @@ following routines:
void tick(picture pic=currentpicture, pair z,
pair dir, real size=Ticksize, pen p=currentpen);
void labelx(picture pic=currentpicture, Label L="", explicit pair z,
- align align=S, string format="", pen p=nullpen);
+ align align=S, string format="", pen p=currentpen);
void labelx(picture pic=currentpicture, Label L="", real x,
- align align=S, string format="", pen p=nullpen);
+ align align=S, string format="", pen p=currentpen);
void labelx(picture pic=currentpicture, Label L,
string format="", explicit pen p=currentpen);
void labely(picture pic=currentpicture, Label L="", explicit pair z,
- align align=W, string format="", pen p=nullpen);
+ align align=W, string format="", pen p=currentpen);
void labely(picture pic=currentpicture, Label L="", real y,
- align align=W, string format="", pen p=nullpen);
+ align align=W, string format="", pen p=currentpen);
void labely(picture pic=currentpicture, Label L,
- string format="", explicit pen p=nullpen);
+ string format="", explicit pen p=currentpen);
Here are some simple examples of two-dimensional graphs:
@@ -6972,6 +6990,11 @@ These projections to two dimensions are predefined:
bool center=false)'
This is equivalent to orthographic((x,y,z),up,target,zoom,viewportshift,showtarget,center)
+ The routine triple camera(real alpha, real beta);
+ can be used to compute the camera position with the x axis below
+ the horizontal at angle `alpha', the y axis below the horizontal
+ at angle `beta', and the z axis up.
+
`perspective(triple camera, triple up=Z, triple target=O,
real zoom=1, real angle=0, pair viewportshift=0,
bool showtarget=true, bool autoadjust=true,
@@ -8241,11 +8264,11 @@ packages.
Pictures are deconstructed into the PNG image format, which supports
full alpha channel transparency. Under `Microsoft Windows', this
-requires `Python 2.6.2' and the `Python Imaging Library':
+requires `Python 2.7.3' and the `Python Imaging Library':
- `http://www.python.org/ftp/python/2.6.2/python-2.6.2.msi'
+ `http://www.python.org/ftp/python/2.7.3/python-2.7.3.msi'
- `http://effbot.org/downloads/PIL-1.1.7.win32-py2.6.exe'.
+ `http://effbot.org/downloads/PIL-1.1.7.win32-py2.7.exe'.
On `UNIX' systems, place
`http://effbot.org/downloads/Imaging-1.1.7.tar.gz' in the `Asymptote'
source directory, and type (as the root user):
@@ -8475,7 +8498,7 @@ Index
* -V <1>: Tutorial. (line 19)
* -V: Configuring. (line 6)
* ..: Tutorial. (line 127)
-* .asy: Search paths. (line 13)
+* .asy: Search paths. (line 14)
* /: Arithmetic & logical.
(line 20)
* /=: Self & prefix operators.
@@ -8483,7 +8506,7 @@ Index
* 2D graphs: graph. (line 6)
* 3D graphs: graph3. (line 6)
* 3D grids: grid3. (line 6)
-* 3D PostScript: three. (line 576)
+* 3D PostScript: three. (line 581)
* 3D rendering: Compiling from UNIX source.
(line 16)
* :: Arithmetic & logical.
@@ -8508,11 +8531,11 @@ Index
(line 6)
* ^^: Tutorial. (line 134)
* a4: Configuring. (line 61)
-* abort: Data types. (line 322)
+* abort: Data types. (line 339)
* abs <1>: Mathematical functions.
(line 35)
-* abs: Data types. (line 60)
-* accel <1>: three. (line 502)
+* abs: Data types. (line 62)
+* accel <1>: three. (line 507)
* accel: Paths and guides. (line 115)
* access: Import. (line 6)
* acknowledgments: Credits. (line 6)
@@ -8524,7 +8547,7 @@ Index
(line 6)
* add <1>: three. (line 271)
* add: Frames and pictures. (line 196)
-* addViews: three. (line 388)
+* addViews: three. (line 393)
* adjust: Pens. (line 115)
* Ai: Mathematical functions.
(line 48)
@@ -8532,16 +8555,16 @@ Index
(line 48)
* Airy: Mathematical functions.
(line 48)
-* alias <1>: Arrays. (line 187)
+* alias <1>: Arrays. (line 181)
* alias: Structures. (line 52)
* align: Options. (line 168)
* Align: label. (line 12)
-* all: Arrays. (line 335)
+* all: Arrays. (line 329)
* Allow: Pens. (line 327)
* AND: Arithmetic & logical.
(line 80)
* and: Bezier curves. (line 56)
-* angle: Data types. (line 68)
+* angle: Data types. (line 70)
* animate <1>: animation. (line 12)
* animate <2>: Files. (line 154)
* animate: Configuring. (line 67)
@@ -8552,17 +8575,18 @@ Index
* antialiasing: Compiling from UNIX source.
(line 16)
* append <1>: Arrays. (line 39)
-* append: Files. (line 35)
+* append: Files. (line 36)
* arc: three. (line 283)
* Arc: Paths and guides. (line 32)
* arc: Paths and guides. (line 22)
* ArcArrow: draw. (line 26)
-* ArcArrow3: three. (line 543)
+* ArcArrow3: three. (line 548)
* ArcArrows: draw. (line 26)
-* ArcArrows3: three. (line 543)
-* arclength <1>: three. (line 502)
+* ArcArrows3: three. (line 548)
+* arclength <1>: three. (line 507)
* arclength: Paths and guides. (line 142)
-* arctime <1>: three. (line 502)
+* arcpoint: Paths and guides. (line 152)
+* arctime <1>: three. (line 507)
* arctime: Paths and guides. (line 146)
* arguments: Default arguments. (line 6)
* arithmetic operators: Arithmetic & logical.
@@ -8570,15 +8594,16 @@ Index
* array: Arrays. (line 122)
* array iteration: Programming. (line 33)
* arrays: Arrays. (line 6)
-* arrow: label. (line 72)
+* arrow: label. (line 71)
* Arrow: draw. (line 26)
* arrow: Drawing commands. (line 31)
* arrow keys: Tutorial. (line 37)
-* Arrow3: three. (line 543)
+* Arrow3: three. (line 548)
* Arrows: draw. (line 26)
* arrows: draw. (line 26)
-* Arrows3: three. (line 543)
+* Arrows3: three. (line 548)
* as: Import. (line 68)
+* ascii: Data types. (line 286)
* aSin: Mathematical functions.
(line 20)
* asin: Mathematical functions.
@@ -8586,12 +8611,13 @@ Index
* asinh: Mathematical functions.
(line 6)
* Aspect: Frames and pictures. (line 54)
-* assert: Data types. (line 327)
+* assert: Data types. (line 344)
* assignment: Programming. (line 8)
-* asy: Import. (line 102)
+* asy <1>: Import. (line 102)
+* asy: Data types. (line 334)
* asy-mode: Editing modes. (line 6)
* asy.vim: Editing modes. (line 33)
-* asyinclude: LaTeX usage. (line 44)
+* asyinclude: LaTeX usage. (line 46)
* asymptote.sty: LaTeX usage. (line 6)
* asymptote.xml: Editing modes. (line 49)
* ASYMPTOTE_CONFIG: Options. (line 115)
@@ -8605,41 +8631,41 @@ Index
(line 6)
* atleast: Bezier curves. (line 56)
* attach <1>: graph. (line 415)
-* attach: LaTeX usage. (line 49)
-* autoadjust: three. (line 354)
+* attach: LaTeX usage. (line 51)
+* autoadjust: three. (line 359)
* autoimport: Options. (line 111)
* automatic scaling: graph. (line 682)
* axialshade: fill. (line 43)
* axis <1>: graph3. (line 66)
* axis: graph. (line 880)
-* azimuth: Data types. (line 124)
+* azimuth: Data types. (line 126)
* babel: babel. (line 6)
* background color: Frames and pictures. (line 168)
-* BackView: three. (line 381)
+* BackView: three. (line 386)
* Bar: draw. (line 19)
-* Bar3: three. (line 543)
+* Bar3: three. (line 548)
* Bars: draw. (line 19)
-* Bars3: three. (line 543)
+* Bars3: three. (line 548)
* barsize: draw. (line 19)
* base modules: Base modules. (line 6)
* basealign: Pens. (line 168)
-* baseline: label. (line 92)
+* baseline: label. (line 91)
* batch mode: Tutorial. (line 6)
-* beep: Data types. (line 340)
+* beep: Data types. (line 357)
* BeginArcArrow: draw. (line 26)
-* BeginArcArrow3: three. (line 543)
+* BeginArcArrow3: three. (line 548)
* BeginArrow: draw. (line 26)
-* BeginArrow3: three. (line 543)
+* BeginArrow3: three. (line 548)
* BeginBar: draw. (line 19)
-* BeginBar3: three. (line 543)
+* BeginBar3: three. (line 548)
* BeginDotMargin: draw. (line 42)
-* BeginDotMargin3: three. (line 559)
+* BeginDotMargin3: three. (line 564)
* BeginMargin: draw. (line 42)
-* BeginMargin3: three. (line 559)
+* BeginMargin3: three. (line 564)
* BeginPenMargin: draw. (line 42)
-* BeginPenMargin2: three. (line 559)
-* BeginPenMargin3: three. (line 559)
-* BeginPoint: label. (line 57)
+* BeginPenMargin2: three. (line 564)
+* BeginPenMargin3: three. (line 564)
+* BeginPoint: label. (line 56)
* Bessel: Mathematical functions.
(line 48)
* bevel: flowchart. (line 75)
@@ -8650,12 +8676,12 @@ Index
(line 48)
* Bi_deriv: Mathematical functions.
(line 48)
-* Billboard: three. (line 472)
-* binary format: Files. (line 74)
+* Billboard: three. (line 477)
+* binary: Files. (line 75)
+* binary format: Files. (line 75)
* binary operators: Arithmetic & logical.
(line 6)
* binarytree: binarytree. (line 6)
-* binput: Files. (line 74)
* black stripes: three. (line 210)
* Blank: draw. (line 26)
* block.bottom: flowchart. (line 19)
@@ -8675,10 +8701,9 @@ Index
(line 6)
* Bottom: graph. (line 134)
* BottomTop: graph. (line 140)
-* BottomView: three. (line 381)
+* BottomView: three. (line 386)
* bounding box: Frames and pictures. (line 168)
* Bounds: graph3. (line 20)
-* boutput: Files. (line 74)
* box <1>: three. (line 305)
* box: Frames and pictures. (line 22)
* bp: Tutorial. (line 26)
@@ -8687,22 +8712,23 @@ Index
* brick: Pens. (line 251)
* broken axis: graph. (line 783)
* bug reports: Help. (line 23)
-* buildcycle: Paths and guides. (line 255)
+* buildcycle: Paths and guides. (line 258)
* Button-1: GUI. (line 6)
* Button-2: GUI. (line 6)
* BWRainbow: palette. (line 15)
* BWRainbow2: palette. (line 18)
-* C string: Data types. (line 189)
+* C string: Data types. (line 191)
* CAD: CAD. (line 6)
* calculateTransform: Frames and pictures. (line 107)
+* camera: three. (line 354)
* casts: Casts. (line 6)
* cbrt: Mathematical functions.
(line 6)
-* cd: Files. (line 24)
+* cd: Files. (line 25)
* ceil: Mathematical functions.
(line 26)
* center: three. (line 338)
-* Center: label. (line 62)
+* Center: label. (line 61)
* checker: Pens. (line 251)
* Chinese: unicode. (line 12)
* choose: Mathematical functions.
@@ -8724,23 +8750,23 @@ Index
* cm: Tutorial. (line 63)
* cmd: Configuring. (line 34)
* cmyk: Pens. (line 34)
-* colatitude: Data types. (line 129)
+* colatitude: Data types. (line 131)
* color: Pens. (line 23)
* coloredNodes: tube. (line 25)
* coloredpath: tube. (line 18)
* coloredSegments: tube. (line 25)
* colorless: Pens. (line 54)
* colors: Pens. (line 51)
-* comma: Files. (line 60)
-* comma-separated-value mode: Arrays. (line 368)
+* comma: Files. (line 61)
+* comma-separated-value mode: Arrays. (line 362)
* command-line options <1>: Options. (line 6)
* command-line options: Configuring. (line 83)
-* comment character: Files. (line 15)
+* comment character: Files. (line 16)
* compass directions: Tutorial. (line 106)
* Compiling from UNIX source: Compiling from UNIX source.
(line 6)
* complement: Arrays. (line 150)
-* concat: Arrays. (line 183)
+* concat: Arrays. (line 177)
* conditional <1>: Arithmetic & logical.
(line 73)
* conditional: Programming. (line 8)
@@ -8748,7 +8774,7 @@ Index
* configuration file <1>: Options. (line 115)
* configuration file: Configuring. (line 23)
* configuring: Configuring. (line 6)
-* conj: Data types. (line 57)
+* conj: Data types. (line 59)
* constructors: Structures. (line 91)
* context: Options. (line 143)
* continue <1>: Debugger. (line 31)
@@ -8757,7 +8783,7 @@ Index
* contour3: contour3. (line 6)
* controls <1>: three. (line 6)
* controls: Bezier curves. (line 45)
-* controlSpecifier: Paths and guides. (line 379)
+* controlSpecifier: Paths and guides. (line 382)
* convert <1>: Options. (line 143)
* convert <2>: animation. (line 6)
* convert <3>: Files. (line 154)
@@ -8775,33 +8801,33 @@ Index
* crop: graph. (line 636)
* cropping graphs: graph. (line 636)
* cross <1>: graph. (line 484)
-* cross: Data types. (line 167)
+* cross: Data types. (line 169)
* crossframe: markers. (line 23)
* crosshatch: Pens. (line 267)
-* csv: Arrays. (line 368)
+* csv: Arrays. (line 362)
* CTZ: Arithmetic & logical.
(line 80)
-* cubicroots: Arrays. (line 324)
+* cubicroots: Arrays. (line 318)
* curl <1>: three. (line 6)
* curl: Bezier curves. (line 63)
-* curlSpecifier: Paths and guides. (line 391)
+* curlSpecifier: Paths and guides. (line 394)
* currentpen: Pens. (line 6)
-* currentprojection: three. (line 378)
+* currentprojection: three. (line 383)
* curve: slopefield. (line 20)
* custom axis types: graph. (line 144)
* custom mark routine: graph. (line 576)
* custom tick locations: graph. (line 249)
-* cut: Paths and guides. (line 237)
+* cut: Paths and guides. (line 240)
* cycle <1>: three. (line 6)
* cycle: Tutorial. (line 75)
-* cyclic <1>: three. (line 502)
+* cyclic <1>: three. (line 507)
* cyclic <2>: Arrays. (line 39)
* cyclic: Paths and guides. (line 74)
* Cyrillic: unicode. (line 7)
* dashdotted: Pens. (line 95)
* dashed: Pens. (line 95)
* data types: Data types. (line 6)
-* date: Data types. (line 292)
+* date: Data types. (line 298)
* Debian: UNIX binary distributions.
(line 19)
* debugger: Debugger. (line 6)
@@ -8810,7 +8836,7 @@ Index
* default arguments: Default arguments. (line 6)
* defaultformat: graph. (line 175)
* DefaultHead: draw. (line 26)
-* DefaultHead3: three. (line 543)
+* DefaultHead3: three. (line 548)
* defaultpen: Pens. (line 46)
* defaultrender: three. (line 47)
* deferred drawing: simplex. (line 6)
@@ -8818,35 +8844,35 @@ Index
(line 17)
* degrees <1>: Mathematical functions.
(line 17)
-* degrees: Data types. (line 73)
+* degrees: Data types. (line 75)
* delete <1>: Arrays. (line 39)
* delete: Files. (line 149)
* description: Description. (line 6)
-* diagonal: Arrays. (line 309)
+* diagonal: Arrays. (line 303)
* diamond: flowchart. (line 57)
-* dimension: Arrays. (line 373)
-* dir <1>: three. (line 502)
+* dimension: Arrays. (line 367)
+* dir <1>: three. (line 507)
* dir <2>: Paths and guides. (line 98)
-* dir <3>: Data types. (line 85)
+* dir <3>: Data types. (line 87)
* dir: Search paths. (line 10)
* direction specifier: Bezier curves. (line 6)
-* directory: Files. (line 24)
-* dirSpecifier: Paths and guides. (line 373)
-* dirtime: Paths and guides. (line 152)
+* directory: Files. (line 25)
+* dirSpecifier: Paths and guides. (line 376)
+* dirtime: Paths and guides. (line 155)
* display: Configuring. (line 67)
* do: Programming. (line 29)
-* DOSendl: Files. (line 60)
-* DOSnewl: Files. (line 60)
-* dot <1>: Arrays. (line 265)
-* dot <2>: Data types. (line 98)
+* DOSendl: Files. (line 61)
+* DOSnewl: Files. (line 61)
+* dot <1>: Arrays. (line 259)
+* dot <2>: Data types. (line 100)
* dot: draw. (line 83)
* DotMargin: draw. (line 42)
-* DotMargin3: three. (line 559)
+* DotMargin3: three. (line 564)
* DotMargins: draw. (line 42)
-* DotMargins3: three. (line 559)
+* DotMargins3: three. (line 564)
* dotted: Pens. (line 95)
* double deferred drawing: three. (line 256)
-* double precision: Files. (line 74)
+* double precision: Files. (line 75)
* Draw: Frames and pictures. (line 147)
* draw: draw. (line 110)
* Draw: draw. (line 26)
@@ -8870,39 +8896,39 @@ Index
* else: Programming. (line 8)
* emacs: Editing modes. (line 6)
* embed: embed. (line 6)
-* Embedded: three. (line 472)
+* Embedded: three. (line 477)
* empty: Frames and pictures. (line 7)
* EndArcArrow: draw. (line 26)
-* EndArcArrow3: three. (line 543)
+* EndArcArrow3: three. (line 548)
* EndArrow: draw. (line 26)
-* EndArrow3: three. (line 543)
+* EndArrow3: three. (line 548)
* EndBar: draw. (line 19)
-* EndBar3: three. (line 543)
+* EndBar3: three. (line 548)
* EndDotMargin: draw. (line 42)
-* EndDotMargin3: three. (line 559)
-* endl: Files. (line 60)
+* EndDotMargin3: three. (line 564)
+* endl: Files. (line 61)
* EndMargin: draw. (line 42)
-* EndMargin3: three. (line 559)
+* EndMargin3: three. (line 564)
* EndPenMargin: draw. (line 42)
-* EndPenMargin2: three. (line 559)
-* EndPenMargin3: three. (line 559)
-* EndPoint: label. (line 57)
+* EndPenMargin2: three. (line 564)
+* EndPenMargin3: three. (line 564)
+* EndPoint: label. (line 56)
* envelope: Frames and pictures. (line 22)
* environment variables: Configuring. (line 87)
-* eof <1>: Arrays. (line 350)
+* eof <1>: Arrays. (line 344)
* eof: Files. (line 92)
-* eol <1>: Arrays. (line 350)
+* eol <1>: Arrays. (line 344)
* eol: Files. (line 92)
* EPS <1>: Options. (line 143)
-* EPS: label. (line 80)
+* EPS: label. (line 79)
* erase <1>: Frames and pictures. (line 7)
-* erase <2>: Data types. (line 239)
+* erase <2>: Data types. (line 241)
* erase: Tutorial. (line 37)
* erf: Mathematical functions.
(line 6)
* erfc: Mathematical functions.
(line 6)
-* error: Files. (line 15)
+* error: Files. (line 16)
* error bars: graph. (line 532)
* errorbars: graph. (line 484)
* eval: Import. (line 98)
@@ -8910,10 +8936,10 @@ Index
* evenodd: Tutorial. (line 148)
* exit <1>: Debugger. (line 57)
* exit <2>: Interactive mode. (line 59)
-* exit: Data types. (line 331)
+* exit: Data types. (line 348)
* exp: Mathematical functions.
(line 6)
-* expi: Data types. (line 81)
+* expi: Data types. (line 83)
* explicit: Casts. (line 6)
* explicit casts: Casts. (line 21)
* expm1: Mathematical functions.
@@ -8922,21 +8948,21 @@ Index
(line 48)
* extendcap: Pens. (line 129)
* extension <1>: MetaPost. (line 10)
-* extension: Paths and guides. (line 232)
+* extension: Paths and guides. (line 235)
* external: embed. (line 28)
-* extrude: three. (line 496)
+* extrude: three. (line 501)
* F: Mathematical functions.
(line 48)
* fabs: Mathematical functions.
(line 6)
-* face: three. (line 584)
+* face: three. (line 589)
* factorial: Mathematical functions.
(line 39)
* Fedora: UNIX binary distributions.
(line 15)
* feynman: feynman. (line 6)
* fft <1>: math. (line 26)
-* fft: Arrays. (line 252)
+* fft: Arrays. (line 246)
* FFTW: Compiling from UNIX source.
(line 58)
* file <1>: Debugger. (line 45)
@@ -8951,15 +8977,15 @@ Index
* filloutside: fill. (line 27)
* fillrule: Pens. (line 152)
* find <1>: Arrays. (line 159)
-* find: Data types. (line 224)
-* firstcut: Paths and guides. (line 247)
+* find: Data types. (line 226)
+* firstcut: Paths and guides. (line 250)
* fit: Frames and pictures. (line 103)
* fit3: three. (line 269)
* fixedscaling: Frames and pictures. (line 74)
* floor: Mathematical functions.
(line 26)
* flowchart: flowchart. (line 6)
-* flush: Files. (line 60)
+* flush: Files. (line 61)
* fmod: Mathematical functions.
(line 6)
* font: Pens. (line 192)
@@ -8968,13 +8994,13 @@ Index
* fontsize: Pens. (line 178)
* for: Programming. (line 8)
* format <1>: Options. (line 143)
-* format: Data types. (line 267)
+* format: Data types. (line 269)
* forum: Help. (line 6)
* frame: Frames and pictures. (line 7)
* freeglut: Compiling from UNIX source.
(line 16)
* from: Import. (line 17)
-* FrontView: three. (line 381)
+* FrontView: three. (line 386)
* function declarations: Functions. (line 67)
* function shading: fill. (line 96)
* Function shading: fill. (line 96)
@@ -8987,7 +9013,7 @@ Index
* Gaussrand: Mathematical functions.
(line 39)
* geometry: geometry. (line 6)
-* getc: Files. (line 29)
+* getc: Files. (line 30)
* getpair: Files. (line 117)
* getreal: Files. (line 117)
* getstring: Files. (line 117)
@@ -9001,7 +9027,7 @@ Index
* gradient shading: fill. (line 32)
* graph: graph. (line 6)
* graph3: graph3. (line 6)
-* graphic: label. (line 80)
+* graphic: label. (line 79)
* graphical user interface: GUI. (line 6)
* gray: Pens. (line 25)
* Grayscale: palette. (line 9)
@@ -9018,27 +9044,27 @@ Index
* GUI: GUI. (line 6)
* GUI installation: GUI installation. (line 6)
* GUI usage: GUI usage. (line 6)
-* guide: Paths and guides. (line 300)
+* guide: Paths and guides. (line 303)
* guide3: three. (line 6)
* hatch: Pens. (line 267)
-* height: LaTeX usage. (line 49)
+* height: LaTeX usage. (line 51)
* help <1>: Debugger. (line 30)
* help <2>: Help. (line 6)
* help: Interactive mode. (line 44)
* Hermite: graph. (line 37)
* Hermite(splinetype splinetype: graph. (line 37)
* hex <1>: Pens. (line 60)
-* hex: Data types. (line 280)
+* hex: Data types. (line 283)
* hexidecimal <1>: Pens. (line 59)
-* hexidecimal: Data types. (line 280)
-* hidden surface removal: three. (line 584)
+* hexidecimal: Data types. (line 283)
+* hidden surface removal: three. (line 589)
* histogram: Mathematical functions.
(line 39)
* history <1>: Interactive mode. (line 59)
* history: Files. (line 142)
* historylines: Interactive mode. (line 64)
* HookHead: draw. (line 26)
-* HookHead3: three. (line 543)
+* HookHead3: three. (line 548)
* Horizontal: flowchart. (line 81)
* hyperrefOptions: Options. (line 130)
* hypot: Mathematical functions.
@@ -9048,11 +9074,11 @@ Index
* i_scaled: Mathematical functions.
(line 48)
* iconic: three. (line 210)
-* identity <1>: Arrays. (line 306)
+* identity <1>: Arrays. (line 300)
* identity <2>: Mathematical functions.
(line 6)
* identity: Transforms. (line 24)
-* identity4: three. (line 432)
+* identity4: three. (line 437)
* if: Programming. (line 8)
* IgnoreAspect: Frames and pictures. (line 58)
* image: palette. (line 34)
@@ -9065,47 +9091,50 @@ Index
* implicit scaling: Implicit scaling. (line 6)
* import: Import. (line 46)
* inches: Tutorial. (line 63)
-* including images: label. (line 80)
+* include: Import. (line 127)
+* including images: label. (line 79)
* increasing: math. (line 59)
+* inf: Data types. (line 33)
* inheritance: Structures. (line 181)
* initialized: Arrays. (line 39)
* initializers: Variable initializers.
(line 6)
-* inline: LaTeX usage. (line 49)
+* inline: LaTeX usage. (line 51)
* InOutTicks: graph3. (line 34)
* input <1>: Interactive mode. (line 48)
-* input: Files. (line 11)
+* input: Files. (line 10)
* insert <1>: Arrays. (line 39)
-* insert: Data types. (line 235)
-* inside: Paths and guides. (line 279)
+* insert: Data types. (line 237)
+* inside: Paths and guides. (line 282)
* inst: Debugger. (line 36)
* installation: Installation. (line 6)
* int: Data types. (line 28)
* integer division: Arithmetic & logical.
(line 6)
* interactive mode: Interactive mode. (line 6)
-* interior: Paths and guides. (line 275)
+* interior: Paths and guides. (line 278)
* international characters: unicode. (line 6)
* interp: Arithmetic & logical.
(line 76)
* interpolate: interpolate. (line 6)
-* intersect <1>: three. (line 502)
+* intersect <1>: three. (line 507)
* intersect <2>: math. (line 13)
-* intersect: Paths and guides. (line 181)
-* intersectionpoint <1>: three. (line 502)
+* intersect: Paths and guides. (line 184)
+* intersectionpoint <1>: three. (line 507)
* intersectionpoint <2>: math. (line 17)
-* intersectionpoint: Paths and guides. (line 224)
-* intersectionpoints <1>: three. (line 502)
-* intersectionpoints: Paths and guides. (line 228)
-* intersections <1>: three. (line 502)
-* intersections: Paths and guides. (line 192)
+* intersectionpoint: Paths and guides. (line 227)
+* intersectionpoints <1>: three. (line 507)
+* intersectionpoints: Paths and guides. (line 231)
+* intersections <1>: three. (line 507)
+* intersections: Paths and guides. (line 195)
* InTicks: graph3. (line 34)
* intMax: Data types. (line 28)
* intMin: Data types. (line 28)
-* inverse <1>: Arrays. (line 312)
+* inverse <1>: Arrays. (line 306)
* inverse: Transforms. (line 16)
-* invert: three. (line 422)
+* invert: three. (line 427)
* invisible: Pens. (line 39)
+* isnan: Data types. (line 33)
* J: Mathematical functions.
(line 6)
* Japanese: unicode. (line 12)
@@ -9115,7 +9144,7 @@ Index
(line 48)
* Kate: Editing modes. (line 49)
* KDE editor: Editing modes. (line 49)
-* keepAspect <1>: LaTeX usage. (line 49)
+* keepAspect <1>: LaTeX usage. (line 51)
* keepAspect: Frames and pictures. (line 54)
* keyboard bindings:: three. (line 169)
* keys: Arrays. (line 39)
@@ -9123,9 +9152,9 @@ Index
* keyword-only: Named arguments. (line 37)
* keywords: Named arguments. (line 6)
* Korean: unicode. (line 12)
-* label: three. (line 466)
+* label: three. (line 471)
* Label <1>: graph. (line 342)
-* Label: label. (line 15)
+* Label: label. (line 14)
* label: clip. (line 16)
* Label: draw. (line 98)
* labelpath: labelpath. (line 6)
@@ -9133,32 +9162,32 @@ Index
* labelx: graph. (line 342)
* labely: graph. (line 342)
* Landscape: Frames and pictures. (line 95)
-* lastcut: Paths and guides. (line 251)
+* lastcut: Paths and guides. (line 254)
* lasy-mode: Editing modes. (line 6)
* latex: Options. (line 143)
* LaTeX fonts: Pens. (line 192)
* LaTeX usage: LaTeX usage. (line 6)
-* latexmk: LaTeX usage. (line 29)
+* latexmk: LaTeX usage. (line 30)
* latin1: latin1. (line 6)
-* latitude: Data types. (line 134)
+* latitude: Data types. (line 136)
* latticeshade: fill. (line 32)
* layer: Drawing commands. (line 16)
* leastsquares <1>: graph. (line 902)
* leastsquares: stats. (line 6)
* Left: graph. (line 284)
* LeftRight: graph. (line 290)
-* LeftSide: label. (line 62)
+* LeftSide: label. (line 61)
* LeftTicks: graph. (line 161)
-* LeftView: three. (line 381)
+* LeftView: three. (line 386)
* legend <1>: graph. (line 431)
* legend <2>: draw. (line 64)
* legend: Drawing commands. (line 31)
* Legendre: Mathematical functions.
(line 48)
-* length <1>: three. (line 502)
+* length <1>: three. (line 507)
* length <2>: Arrays. (line 39)
* length <3>: Paths and guides. (line 65)
-* length: Data types. (line 60)
+* length: Data types. (line 62)
* letter: Configuring. (line 61)
* lexorder: math. (line 68)
* libm routines: Mathematical functions.
@@ -9166,15 +9195,15 @@ Index
* libsigsegv <1>: Help. (line 33)
* libsigsegv: Functions. (line 88)
* limits: graph. (line 636)
-* line: Arrays. (line 350)
-* line mode: Arrays. (line 350)
+* line: Arrays. (line 344)
+* line mode: Arrays. (line 344)
* Linear: graph. (line 682)
* linecap: Pens. (line 129)
* linejoin: Pens. (line 138)
* lineskip: Pens. (line 178)
* linetype: Pens. (line 115)
* linewidth: Pens. (line 119)
-* locale: Data types. (line 287)
+* locale: Data types. (line 293)
* Log: graph. (line 682)
* log: Mathematical functions.
(line 6)
@@ -9189,59 +9218,60 @@ Index
(line 6)
* longdashdotted: Pens. (line 95)
* longdashed: Pens. (line 95)
-* longitude: Data types. (line 139)
+* longitude: Data types. (line 141)
* loop: Programming. (line 8)
* MacOS X binary distributions: MacOS X binary distributions.
(line 6)
* makepen: Pens. (line 300)
* map: Arrays. (line 141)
* Margin: draw. (line 42)
-* Margin3: three. (line 559)
+* Margin3: three. (line 564)
* margins: three. (line 262)
* Margins: draw. (line 42)
-* Margins3: three. (line 559)
+* Margins3: three. (line 564)
* mark: graph. (line 484)
* markangle: markers. (line 38)
* marker: graph. (line 484)
* markers: markers. (line 6)
* marknodes: graph. (line 484)
* markuniform: graph. (line 484)
+* mask: Data types. (line 33)
* math: math. (line 6)
* mathematical functions: Mathematical functions.
(line 6)
-* max <1>: three. (line 502)
-* max <2>: Arrays. (line 231)
+* max <1>: three. (line 507)
+* max <2>: Arrays. (line 225)
* max <3>: Frames and pictures. (line 7)
-* max: Paths and guides. (line 264)
-* maxbound: Data types. (line 104)
+* max: Paths and guides. (line 267)
+* maxbound: Data types. (line 106)
* maxtile: three. (line 210)
-* maxtimes: Paths and guides. (line 219)
+* maxtimes: Paths and guides. (line 222)
* maxviewport: three. (line 210)
* MetaPost: MetaPost. (line 6)
* MetaPost ... : Bezier curves. (line 67)
-* MetaPost cutafter: Paths and guides. (line 252)
-* MetaPost cutbefore: Paths and guides. (line 248)
+* MetaPost cutafter: Paths and guides. (line 255)
+* MetaPost cutbefore: Paths and guides. (line 251)
* MetaPost pickup: Pens. (line 6)
* MetaPost whatever: MetaPost. (line 10)
* Microsoft Windows: Microsoft Windows. (line 6)
* MidArcArrow: draw. (line 26)
-* MidArcArrow3: three. (line 543)
+* MidArcArrow3: three. (line 548)
* MidArrow: draw. (line 26)
-* MidArrow3: three. (line 543)
-* midpoint: Paths and guides. (line 166)
-* MidPoint: label. (line 57)
-* min <1>: three. (line 502)
-* min <2>: Arrays. (line 224)
+* MidArrow3: three. (line 548)
+* midpoint: Paths and guides. (line 169)
+* MidPoint: label. (line 56)
+* min <1>: three. (line 507)
+* min <2>: Arrays. (line 218)
* min <3>: Frames and pictures. (line 7)
-* min: Paths and guides. (line 260)
-* minbound: Data types. (line 101)
-* minipage: label. (line 119)
-* mintimes: Paths and guides. (line 214)
+* min: Paths and guides. (line 263)
+* minbound: Data types. (line 103)
+* minipage: label. (line 118)
+* mintimes: Paths and guides. (line 217)
* miterjoin: Pens. (line 138)
* miterlimit: Pens. (line 147)
-* mktemp: Files. (line 43)
+* mktemp: Files. (line 44)
* mm: Tutorial. (line 63)
-* mode: Files. (line 88)
+* mode: Files. (line 75)
* monotonic: graph. (line 37)
* mouse: GUI. (line 6)
* mouse bindings: three. (line 137)
@@ -9257,19 +9287,19 @@ Index
* new <1>: Arrays. (line 109)
* new: Structures. (line 6)
* newframe: Frames and pictures. (line 7)
-* newl: Files. (line 60)
+* newl: Files. (line 61)
* newton: Mathematical functions.
- (line 65)
+ (line 66)
* next: Debugger. (line 42)
* NFSS: Pens. (line 192)
* nobasealign: Pens. (line 168)
* NoFill <1>: Frames and pictures. (line 141)
* NoFill: draw. (line 26)
* NoMargin: draw. (line 42)
-* NoMargin3: three. (line 559)
-* none: Files. (line 60)
+* NoMargin3: three. (line 564)
+* none: Files. (line 61)
* None: draw. (line 19)
-* normal: three. (line 488)
+* normal: three. (line 493)
* nosafe: Options. (line 163)
* NOT: Arithmetic & logical.
(line 80)
@@ -9279,7 +9309,7 @@ Index
* null: Structures. (line 6)
* nullpen <1>: Frames and pictures. (line 127)
* nullpen: label. (line 14)
-* NURBS: three. (line 358)
+* NURBS: three. (line 363)
* O: three. (line 274)
* obj: obj. (line 9)
* oblique: three. (line 319)
@@ -9293,7 +9323,7 @@ Index
* OmitTickInterval: graph. (line 239)
* OmitTickIntervals: graph. (line 239)
* opacity: Pens. (line 222)
-* open: Files. (line 11)
+* open: Files. (line 12)
* OpenGL: three. (line 127)
* operator: User-defined operators.
(line 6)
@@ -9314,17 +9344,17 @@ Index
* outformat: three. (line 127)
* outprefix: Frames and pictures. (line 83)
* output <1>: Options. (line 143)
-* output: Files. (line 35)
+* output: Files. (line 36)
* OutTicks: graph3. (line 34)
* overloading functions: Functions. (line 44)
* overwrite: Pens. (line 324)
* P: Mathematical functions.
(line 48)
-* pack: label. (line 102)
+* pack: label. (line 101)
* packing: Rest arguments. (line 30)
-* pair <1>: Data types. (line 41)
+* pair <1>: Data types. (line 43)
* pair: Tutorial. (line 51)
-* pairs: Arrays. (line 248)
+* pairs: Arrays. (line 242)
* paperheight: Configuring. (line 61)
* papertype: Configuring. (line 61)
* paperwidth: Configuring. (line 61)
@@ -9347,33 +9377,33 @@ Index
* pdfviewerOptions: Options. (line 130)
* pen: Pens. (line 6)
* PenMargin: draw. (line 42)
-* PenMargin2: three. (line 559)
-* PenMargin3: three. (line 559)
+* PenMargin2: three. (line 564)
+* PenMargin3: three. (line 564)
* PenMargins: draw. (line 42)
-* PenMargins2: three. (line 559)
-* PenMargins3: three. (line 559)
+* PenMargins2: three. (line 564)
+* PenMargins3: three. (line 564)
* periodic: graph. (line 37)
-* perl: LaTeX usage. (line 29)
+* perl: LaTeX usage. (line 30)
* perpendicular: geometry. (line 6)
-* perspective: three. (line 358)
+* perspective: three. (line 363)
* picture: Frames and pictures. (line 35)
* picture alignment: Frames and pictures. (line 209)
* piecewisestraight: Paths and guides. (line 81)
-* pixel: three. (line 566)
+* pixel: three. (line 571)
* Pl: Mathematical functions.
(line 48)
* plain: plain. (line 6)
* planar: three. (line 89)
* plane: three. (line 301)
-* planeproject: three. (line 485)
-* point <1>: three. (line 502)
+* planeproject: three. (line 490)
+* point <1>: three. (line 507)
* point: Paths and guides. (line 84)
-* polar: Data types. (line 119)
+* polar: Data types. (line 121)
* polargraph: graph. (line 90)
* polygon: graph. (line 484)
* pop: Arrays. (line 39)
* Portrait: Frames and pictures. (line 95)
-* postcontrol <1>: three. (line 502)
+* postcontrol <1>: three. (line 507)
* postcontrol: Paths and guides. (line 135)
* postfix operators: Self & prefix operators.
(line 19)
@@ -9384,7 +9414,7 @@ Index
(line 6)
* prc: three. (line 231)
* precision: Files. (line 92)
-* precontrol <1>: three. (line 502)
+* precontrol <1>: three. (line 507)
* precontrol: Paths and guides. (line 128)
* prefix operators: Self & prefix operators.
(line 6)
@@ -9399,8 +9429,9 @@ Index
* public: Structures. (line 6)
* push: Arrays. (line 39)
* Python usage: Interactive mode. (line 80)
-* quadraticroots: Arrays. (line 315)
+* quadraticroots: Arrays. (line 309)
* quarticroots: math. (line 22)
+* quick reference: Description. (line 80)
* quit <1>: Debugger. (line 54)
* quit <2>: Interactive mode. (line 59)
* quit: Tutorial. (line 37)
@@ -9412,56 +9443,57 @@ Index
* RadialShadeDraw: Frames and pictures. (line 163)
* radians: Mathematical functions.
(line 17)
-* radius <1>: three. (line 502)
+* radius <1>: three. (line 507)
* radius: Paths and guides. (line 124)
* Rainbow: palette. (line 12)
* rand: Mathematical functions.
(line 39)
* randMax: Mathematical functions.
(line 39)
-* read: Arrays. (line 391)
-* reading: Files. (line 11)
-* reading string arrays: Arrays. (line 360)
+* read: Arrays. (line 385)
+* reading: Files. (line 12)
+* reading string arrays: Arrays. (line 354)
* readline: Files. (line 134)
* real: Data types. (line 33)
* realDigits: Data types. (line 33)
* realEpsilon: Data types. (line 33)
* realMax: Data types. (line 33)
* realMin: Data types. (line 33)
-* realmult: Data types. (line 95)
+* realmult: Data types. (line 97)
* rectangle: flowchart. (line 37)
* recursion: Functions. (line 88)
+* reference: Description. (line 80)
* reflect: Transforms. (line 51)
-* Relative: label. (line 52)
-* relpoint: Paths and guides. (line 162)
-* reltime: Paths and guides. (line 158)
+* Relative: label. (line 51)
+* relpoint: Paths and guides. (line 165)
+* reltime: Paths and guides. (line 161)
* remainder: Mathematical functions.
(line 6)
* rename: Files. (line 151)
* render <1>: Options. (line 143)
* render: three. (line 47)
-* replace: Data types. (line 252)
+* replace: Data types. (line 254)
* resetdefaultpen: Pens. (line 353)
* rest arguments: Rest arguments. (line 6)
* restore: Frames and pictures. (line 265)
* restricted: Structures. (line 6)
* return: Debugger. (line 48)
-* reverse <1>: three. (line 502)
+* reverse <1>: three. (line 507)
* reverse <2>: Arrays. (line 146)
-* reverse <3>: Paths and guides. (line 169)
-* reverse: Data types. (line 248)
+* reverse <3>: Paths and guides. (line 172)
+* reverse: Data types. (line 250)
* rewind: Files. (line 92)
-* rfind: Data types. (line 229)
+* rfind: Data types. (line 231)
* rgb: Pens. (line 30)
* Riemann zeta function: Mathematical functions.
(line 48)
* Right: graph. (line 287)
-* RightSide: label. (line 62)
+* RightSide: label. (line 61)
* RightTicks: graph. (line 161)
-* RightView: three. (line 381)
-* rotate: three. (line 453)
-* Rotate: label. (line 37)
-* Rotate(pair z): label. (line 40)
+* RightView: three. (line 386)
+* rotate: three. (line 458)
+* Rotate: label. (line 36)
+* Rotate(pair z): label. (line 39)
* round: Mathematical functions.
(line 26)
* roundcap: Pens. (line 129)
@@ -9476,13 +9508,13 @@ Index
* safe: Options. (line 163)
* save: Frames and pictures. (line 262)
* saveline: Files. (line 134)
-* scale: three. (line 452)
+* scale: three. (line 457)
* Scale: graph. (line 698)
* scale <1>: graph. (line 682)
* scale <2>: Transforms. (line 39)
* scale: Pens. (line 115)
-* Scale: label. (line 46)
-* scale3: three. (line 449)
+* Scale: label. (line 45)
+* scale3: three. (line 454)
* scaled graph: graph. (line 663)
* scientific graph: graph. (line 396)
* scroll: Files. (line 108)
@@ -9492,7 +9524,7 @@ Index
* secondary axis: graph. (line 813)
* secondaryX: graph. (line 813)
* secondaryY: graph. (line 813)
-* seconds: Data types. (line 300)
+* seconds: Data types. (line 306)
* seek: Files. (line 92)
* seekeof: Files. (line 92)
* segment: math. (line 50)
@@ -9505,51 +9537,53 @@ Index
* sgn: Mathematical functions.
(line 26)
* shading: fill. (line 32)
-* shift <1>: three. (line 437)
+* shift <1>: three. (line 442)
* shift: Transforms. (line 27)
-* Shift: label. (line 34)
+* Shift: label. (line 33)
* shiftless: Transforms. (line 53)
* shipout: Frames and pictures. (line 83)
* showtarget: three. (line 338)
* Si: Mathematical functions.
(line 48)
-* signedint: Files. (line 74)
+* signedint: Files. (line 75)
* SimpleHead: draw. (line 26)
* simplex: simplex. (line 6)
* simpson: Mathematical functions.
- (line 81)
+ (line 82)
* Sin: Mathematical functions.
(line 20)
* sin: Mathematical functions.
(line 6)
-* single precision: Files. (line 74)
-* singleint: Files. (line 74)
-* singlereal: Files. (line 74)
+* single precision: Files. (line 75)
+* singleint: Files. (line 75)
+* singlereal: Files. (line 75)
* sinh: Mathematical functions.
(line 6)
-* SixViews: three. (line 396)
-* SixViewsFR: three. (line 396)
-* SixViewsUS: three. (line 396)
+* SixViews: three. (line 401)
+* SixViewsFR: three. (line 401)
+* SixViewsUS: three. (line 401)
* size <1>: Options. (line 143)
-* size <2>: three. (line 502)
+* size <2>: three. (line 507)
* size <3>: Frames and pictures. (line 43)
* size: Paths and guides. (line 70)
* size3: three. (line 259)
* slant: Transforms. (line 45)
-* Slant: label. (line 43)
-* sleep: Data types. (line 334)
-* slice: Paths and guides. (line 237)
+* Slant: label. (line 42)
+* sleep: Data types. (line 351)
+* slice: Paths and guides. (line 240)
* slices: Slices. (line 6)
* slide: slide. (line 6)
* slope: math. (line 44)
* slopefield: slopefield. (line 6)
+* sndncn: Mathematical functions.
+ (line 48)
* solid: Pens. (line 95)
* solids: solids. (line 9)
-* solve: Arrays. (line 284)
-* sort: Arrays. (line 190)
+* solve: Arrays. (line 278)
+* sort: Arrays. (line 184)
* Spline <1>: graph3. (line 100)
* Spline: graph. (line 34)
-* split: Data types. (line 261)
+* split: Data types. (line 263)
* sqrt: Mathematical functions.
(line 6)
* squarecap: Pens. (line 129)
@@ -9559,27 +9593,27 @@ Index
* stack overflow: Functions. (line 88)
* static: Static. (line 6)
* stats: stats. (line 6)
-* stdin: Files. (line 47)
-* stdout: Files. (line 47)
+* stdin: Files. (line 48)
+* stdout: Files. (line 48)
* step: Debugger. (line 39)
* stickframe: markers. (line 16)
* stop: Debugger. (line 10)
-* straight: three. (line 502)
+* straight: three. (line 507)
* Straight: graph. (line 31)
* straight: Paths and guides. (line 77)
-* strftime: Data types. (line 292)
-* string: Data types. (line 179)
+* strftime: Data types. (line 298)
+* string: Data types. (line 181)
* stroke: fill. (line 36)
-* strokepath: Paths and guides. (line 294)
-* strptime: Data types. (line 300)
+* strokepath: Paths and guides. (line 297)
+* strptime: Data types. (line 306)
* struct: Structures. (line 6)
* structures: Structures. (line 6)
-* subpath <1>: three. (line 502)
-* subpath: Paths and guides. (line 172)
+* subpath <1>: three. (line 507)
+* subpath: Paths and guides. (line 175)
* subpictures: Frames and pictures. (line 103)
-* substr: Data types. (line 244)
+* substr: Data types. (line 246)
* Subversion: Subversion. (line 6)
-* sum: Arrays. (line 219)
+* sum: Arrays. (line 213)
* superpath: Tutorial. (line 134)
* Suppress: Pens. (line 331)
* SuppressQuiet: Pens. (line 335)
@@ -9588,9 +9622,9 @@ Index
* SVG: Options. (line 143)
* SVN: Subversion. (line 6)
* system <1>: Options. (line 163)
-* system: Files. (line 159)
+* system: Data types. (line 328)
* syzygy: syzygy. (line 6)
-* tab: Files. (line 60)
+* tab: Files. (line 61)
* tab completion: Tutorial. (line 37)
* Tan: Mathematical functions.
(line 20)
@@ -9602,17 +9636,17 @@ Index
* tell: Files. (line 92)
* tension <1>: three. (line 6)
* tension: Bezier curves. (line 56)
-* tensionSpecifier: Paths and guides. (line 385)
+* tensionSpecifier: Paths and guides. (line 388)
* tensor product shading: fill. (line 74)
* tensorshade: fill. (line 74)
* tex <1>: Options. (line 143)
* tex: Frames and pictures. (line 278)
* TeX fonts: Pens. (line 201)
-* TeX string: Data types. (line 179)
+* TeX string: Data types. (line 181)
* texcommand: Configuring. (line 67)
* TeXHead: draw. (line 26)
-* TeXHead3: three. (line 543)
-* texpath <1>: label. (line 116)
+* TeXHead3: three. (line 548)
+* texpath <1>: label. (line 115)
* texpath: Configuring. (line 67)
* texpreamble: Frames and pictures. (line 286)
* texreset: Frames and pictures. (line 289)
@@ -9623,9 +9657,9 @@ Index
* thin: three. (line 110)
* this: Structures. (line 6)
* three: three. (line 6)
-* ThreeViews: three. (line 396)
-* ThreeViewsFR: three. (line 396)
-* ThreeViewsUS: three. (line 396)
+* ThreeViews: three. (line 401)
+* ThreeViewsFR: three. (line 401)
+* ThreeViewsUS: three. (line 401)
* tick: graph. (line 342)
* Ticks: graph. (line 161)
* ticks: graph. (line 161)
@@ -9633,35 +9667,35 @@ Index
* tile: Pens. (line 251)
* tilings: Pens. (line 238)
* time <1>: math. (line 30)
-* time: Data types. (line 292)
-* times: Paths and guides. (line 206)
+* time: Data types. (line 298)
+* times: Paths and guides. (line 209)
* Top: graph. (line 137)
-* TopView: three. (line 381)
+* TopView: three. (line 386)
* trace: Debugger. (line 51)
* trailingzero: graph. (line 175)
-* transform <1>: three. (line 477)
+* transform <1>: three. (line 482)
* transform: Transforms. (line 6)
-* transform3: three. (line 432)
+* transform3: three. (line 437)
* transparency: Pens. (line 222)
-* transpose: Arrays. (line 211)
+* transpose: Arrays. (line 205)
* tree: tree. (line 9)
* trembling: trembling. (line 6)
* triangle: geometry. (line 6)
* triangulate: contour. (line 157)
-* tridiagonal: Arrays. (line 272)
+* tridiagonal: Arrays. (line 266)
* trigonometric integrals: Mathematical functions.
(line 48)
-* triple: Data types. (line 108)
+* triple: Data types. (line 110)
* TrueMargin: draw. (line 42)
-* TrueMargin3: three. (line 559)
+* TrueMargin3: three. (line 564)
* tube <1>: tube. (line 6)
* tube: three. (line 110)
* tutorial: Tutorial. (line 6)
* type1cm: Pens. (line 178)
* typedef <1>: Functions. (line 36)
-* typedef: Data types. (line 344)
+* typedef: Data types. (line 361)
* U3D: embed. (line 38)
-* undefined: Paths and guides. (line 268)
+* undefined: Paths and guides. (line 271)
* UnFill: Frames and pictures. (line 152)
* unfill: fill. (line 106)
* UnFill: draw. (line 26)
@@ -9669,7 +9703,7 @@ Index
* uniform: Arrays. (line 155)
* Uninstall: Uninstall. (line 6)
* unique: math. (line 64)
-* unit: Data types. (line 78)
+* unit: Data types. (line 80)
* unitbox <1>: three. (line 307)
* unitbox: Tutorial. (line 155)
* unitcircle <1>: three. (line 274)
@@ -9683,13 +9717,13 @@ Index
* unpacking: Rest arguments. (line 39)
* unravel: Import. (line 30)
* up: three. (line 338)
-* update: Files. (line 35)
+* update: Files. (line 36)
* UpsideDown: Frames and pictures. (line 95)
* usepackage: Frames and pictures. (line 291)
* user coordinates: Tutorial. (line 86)
* user-defined operators: User-defined operators.
(line 6)
-* usleep: Data types. (line 337)
+* usleep: Data types. (line 354)
* value: math. (line 38)
* var: Variable initializers.
(line 63)
@@ -9697,46 +9731,45 @@ Index
(line 6)
* vectorfield: graph. (line 975)
* vectorfield3: graph3. (line 159)
-* vectorization: Arrays. (line 329)
+* vectorization: Arrays. (line 323)
* verbatim: Frames and pictures. (line 271)
* vertex-dependent colors: three. (line 81)
* Vertical: flowchart. (line 81)
-* viewportheight: LaTeX usage. (line 49)
+* viewportheight: LaTeX usage. (line 51)
* viewportmargin: three. (line 262)
* viewportsize: three. (line 262)
-* viewportwidth: LaTeX usage. (line 49)
+* viewportwidth: LaTeX usage. (line 51)
* views: three. (line 231)
* vim: Editing modes. (line 33)
* virtual functions: Structures. (line 181)
* void: Data types. (line 10)
* W: Tutorial. (line 106)
-* whatever: Paths and guides. (line 232)
+* whatever: Paths and guides. (line 235)
* Wheel: palette. (line 22)
* wheel mouse: GUI. (line 6)
* while: Programming. (line 29)
-* white-space string delimiter mode: Arrays. (line 360)
-* width: LaTeX usage. (line 49)
-* windingnumber: Paths and guides. (line 268)
-* word: Arrays. (line 360)
-* write <1>: Arrays. (line 400)
-* write: Files. (line 52)
+* white-space string delimiter mode: Arrays. (line 354)
+* width: LaTeX usage. (line 51)
+* windingnumber: Paths and guides. (line 271)
+* word: Arrays. (line 354)
+* write <1>: Arrays. (line 394)
+* write: Files. (line 53)
* X: three. (line 274)
* xasy: GUI. (line 6)
* xaxis3: graph3. (line 7)
+* xdr: Files. (line 75)
* xelatex <1>: Options. (line 143)
* xelatex: embed. (line 10)
* xequals: graph. (line 294)
* XEquals: graph. (line 280)
-* xinput: Files. (line 74)
* xlimits: graph. (line 636)
* XOR: Arithmetic & logical.
(line 80)
-* xoutput: Files. (line 74)
-* xpart: Data types. (line 89)
+* xpart: Data types. (line 91)
* xscale: Transforms. (line 33)
-* xscale3: three. (line 440)
+* xscale3: three. (line 445)
* xtick: graph. (line 342)
-* XY: three. (line 462)
+* XY: three. (line 467)
* XYEquals: graph3. (line 20)
* XYZero: graph3. (line 20)
* XZEquals: graph3. (line 20)
@@ -9749,12 +9782,12 @@ Index
* yequals: graph. (line 294)
* YEquals: graph. (line 130)
* ylimits: graph. (line 636)
-* ypart: Data types. (line 92)
+* ypart: Data types. (line 94)
* yscale: Transforms. (line 36)
-* yscale3: three. (line 443)
+* yscale3: three. (line 448)
* ytick: graph. (line 342)
-* YX: three. (line 477)
-* YZ: three. (line 477)
+* YX: three. (line 482)
+* YZ: three. (line 482)
* YZEquals: graph3. (line 20)
* YZero: graph. (line 125)
* YZZero: graph3. (line 20)
@@ -9773,10 +9806,10 @@ Index
* zerowinding: Pens. (line 152)
* zeta: Mathematical functions.
(line 48)
-* zpart: Data types. (line 161)
-* zscale3: three. (line 446)
-* ZX: three. (line 477)
-* ZY: three. (line 477)
+* zpart: Data types. (line 163)
+* zscale3: three. (line 451)
+* ZX: three. (line 482)
+* ZY: three. (line 482)
* |: Arithmetic & logical.
(line 62)
* ||: Arithmetic & logical.
@@ -9787,145 +9820,144 @@ Index
Tag Table:
Node: Top575
Node: Description6834
-Node: Installation10335
-Node: UNIX binary distributions11388
-Node: MacOS X binary distributions12494
-Node: Microsoft Windows13378
-Ref: psview14088
-Node: Configuring15020
-Node: Search paths19234
-Node: Compiling from UNIX source20031
-Ref: multisampling20620
-Node: Editing modes23026
-Node: Subversion25458
-Node: Uninstall25921
-Node: Tutorial26271
-Ref: unitcircle30569
-Node: Drawing commands32505
-Node: draw34216
-Ref: arrows35364
-Node: fill40607
-Ref: gradient shading41651
-Node: clip45879
-Node: label46471
-Ref: Label47170
-Node: Bezier curves52895
-Node: Programming56472
-Ref: array iteration57286
-Node: Data types58367
-Ref: format67375
-Node: Paths and guides70978
-Ref: circle71232
-Ref: arctime76720
-Ref: extension80575
-Node: Pens87258
-Ref: fillrule94624
-Ref: basealign95521
-Ref: transparency98347
-Ref: makepen101790
-Ref: overwrite102628
-Node: Transforms103838
-Node: Frames and pictures105629
-Ref: envelope106770
-Ref: size107853
-Ref: unitsize108840
-Ref: shipout109900
-Ref: filltype112233
-Ref: add115370
-Ref: add about116316
-Ref: tex119254
-Node: Files120128
-Ref: cd121093
-Ref: scroll125778
-Node: Variable initializers128851
-Node: Structures131576
-Node: Operators139020
-Node: Arithmetic & logical139334
-Node: Self & prefix operators141308
-Node: User-defined operators142096
-Node: Implicit scaling143007
-Node: Functions143570
-Ref: stack overflow146323
-Node: Default arguments146887
-Node: Named arguments147626
-Node: Rest arguments150197
-Node: Mathematical functions153318
-Node: Arrays157925
-Ref: sort165013
-Ref: tridiagonal167417
-Ref: solve168645
-Node: Slices172838
-Node: Casts176728
-Node: Import178693
-Node: Static183920
-Node: LaTeX usage186814
-Node: Base modules193031
-Node: plain195531
-Node: simplex196183
-Node: math196456
-Node: interpolate199161
-Node: geometry199440
-Node: trembling200034
-Node: stats200385
-Node: patterns200645
-Node: markers200881
-Node: tree202664
-Node: binarytree202852
-Node: drawtree203441
-Node: syzygy203645
-Node: feynman203919
-Node: roundedpath204194
-Node: animation204477
-Ref: animate204894
-Node: embed206033
-Node: slide207636
-Node: MetaPost207976
-Node: unicode208692
-Node: latin1209580
-Node: babel209948
-Node: labelpath210177
-Node: labelpath3210997
-Node: annotate211308
-Node: CAD211779
-Node: graph212089
-Ref: ticks219218
-Ref: pathmarkers232497
-Ref: marker232962
-Ref: markuniform233313
-Ref: errorbars235104
-Ref: automatic scaling239160
-Node: palette249806
-Ref: images249924
-Ref: image254096
-Ref: logimage254574
-Ref: penimage255635
-Ref: penfunctionimage255856
-Node: three256580
-Ref: PostScript3D281322
-Node: obj283014
-Node: graph3283266
-Ref: GaussianSurface288391
-Node: grid3289495
-Node: solids290235
-Node: tube291183
-Node: flowchart293418
-Node: contour297987
-Node: contour3303112
-Node: slopefield303419
-Node: ode304856
-Node: Options305116
-Ref: configuration file311104
-Ref: settings311104
-Ref: convert312305
-Node: Interactive mode315272
-Ref: history317425
-Node: GUI318730
-Node: GUI installation319233
-Node: GUI usage320363
-Node: PostScript to Asymptote321266
-Node: Help322022
-Node: Debugger323758
-Node: Credits325543
-Node: Index326475
+Node: Installation10450
+Node: UNIX binary distributions11503
+Node: MacOS X binary distributions12609
+Node: Microsoft Windows13493
+Ref: psview14203
+Node: Configuring15135
+Node: Search paths19349
+Node: Compiling from UNIX source20191
+Ref: multisampling20781
+Node: Editing modes23176
+Node: Subversion25608
+Node: Uninstall26071
+Node: Tutorial26421
+Ref: unitcircle30719
+Node: Drawing commands32655
+Node: draw34366
+Ref: arrows35514
+Node: fill40757
+Ref: gradient shading41801
+Node: clip46029
+Node: label46621
+Ref: Label47219
+Node: Bezier curves53022
+Node: Programming56599
+Ref: array iteration57413
+Node: Data types58494
+Ref: format67691
+Node: Paths and guides71944
+Ref: circle72198
+Ref: extension81622
+Node: Pens88305
+Ref: fillrule95673
+Ref: basealign96570
+Ref: transparency99396
+Ref: makepen102839
+Ref: overwrite103677
+Node: Transforms104887
+Node: Frames and pictures106678
+Ref: envelope107819
+Ref: size108902
+Ref: unitsize109889
+Ref: shipout110949
+Ref: filltype113282
+Ref: add116419
+Ref: add about117365
+Ref: tex120303
+Node: Files121177
+Ref: cd122160
+Ref: scroll126834
+Node: Variable initializers129749
+Node: Structures132474
+Node: Operators139918
+Node: Arithmetic & logical140232
+Node: Self & prefix operators142205
+Node: User-defined operators142993
+Node: Implicit scaling143904
+Node: Functions144467
+Ref: stack overflow147220
+Node: Default arguments147784
+Node: Named arguments148523
+Node: Rest arguments151094
+Node: Mathematical functions154215
+Node: Arrays158880
+Ref: sort165869
+Ref: tridiagonal168273
+Ref: solve169501
+Node: Slices173694
+Node: Casts177584
+Node: Import179549
+Node: Static184786
+Node: LaTeX usage187680
+Node: Base modules194092
+Node: plain196592
+Node: simplex197244
+Node: math197517
+Node: interpolate200222
+Node: geometry200501
+Node: trembling201095
+Node: stats201446
+Node: patterns201706
+Node: markers201942
+Node: tree203725
+Node: binarytree203913
+Node: drawtree204502
+Node: syzygy204706
+Node: feynman204980
+Node: roundedpath205255
+Node: animation205538
+Ref: animate205958
+Node: embed207097
+Node: slide208700
+Node: MetaPost209040
+Node: unicode209756
+Node: latin1210644
+Node: babel211012
+Node: labelpath211241
+Node: labelpath3212061
+Node: annotate212372
+Node: CAD212843
+Node: graph213153
+Ref: ticks220282
+Ref: pathmarkers233576
+Ref: marker234041
+Ref: markuniform234392
+Ref: errorbars236183
+Ref: automatic scaling240239
+Node: palette250885
+Ref: images251003
+Ref: image255175
+Ref: logimage255653
+Ref: penimage256714
+Ref: penfunctionimage256935
+Node: three257659
+Ref: PostScript3D282639
+Node: obj284331
+Node: graph3284583
+Ref: GaussianSurface289708
+Node: grid3290812
+Node: solids291552
+Node: tube292500
+Node: flowchart294735
+Node: contour299304
+Node: contour3304429
+Node: slopefield304736
+Node: ode306173
+Node: Options306433
+Ref: configuration file312421
+Ref: settings312421
+Ref: convert313622
+Node: Interactive mode316589
+Ref: history318742
+Node: GUI320047
+Node: GUI installation320550
+Node: GUI usage321680
+Node: PostScript to Asymptote322583
+Node: Help323339
+Node: Debugger325075
+Node: Credits326860
+Node: Index327792

End Tag Table
diff --git a/Master/texmf/doc/man/man1/asy.man1.pdf b/Master/texmf/doc/man/man1/asy.man1.pdf
index f2e26510730..4cd462f1d30 100644
--- a/Master/texmf/doc/man/man1/asy.man1.pdf
+++ b/Master/texmf/doc/man/man1/asy.man1.pdf
Binary files differ
diff --git a/Master/texmf/doc/man/man1/xasy.man1.pdf b/Master/texmf/doc/man/man1/xasy.man1.pdf
index 23a8435a0fb..ebad4890ee3 100644
--- a/Master/texmf/doc/man/man1/xasy.man1.pdf
+++ b/Master/texmf/doc/man/man1/xasy.man1.pdf
Binary files differ
diff --git a/Master/texmf/tex/latex/asymptote/asymptote.sty b/Master/texmf/tex/latex/asymptote/asymptote.sty
index 6518baba61f..4433f6d607e 100644
--- a/Master/texmf/tex/latex/asymptote/asymptote.sty
+++ b/Master/texmf/tex/latex/asymptote/asymptote.sty
@@ -17,7 +17,7 @@
%% Licence: GPL2+
%%
\ProvidesPackage{asymptote}
- [2011/05/15 v1.24 Asymptote style file for LaTeX]
+ [2011/11/29 v1.26 Asymptote style file for LaTeX]
\def\Asymptote{{\tt Asymptote}}
\InputIfFileExists{\jobname.pre}{}{}
\newbox\ASYbox
@@ -58,12 +58,12 @@
\ENDCATCHFILEMARKER
\noexpand
}%
- \long\def\@tempa##1\ENDCATCHFILEMARKER{%
+ \long\def\@tempa####1\ENDCATCHFILEMARKER{%
\endgroup
- \def#1{##1}%
+ \def##1{####1}%
}%
- #3%
- \expandafter\@tempa\@@input #2\relax
+ ##3%
+ \expandafter\@tempa\@@input ##2\relax
}
}
\newif\if@asy@attachfile@loaded
@@ -252,7 +252,6 @@
\immediate\write\AsyStream{size(\ASYwidth,\ASYheight,\asy@expand@keepAspect);}%
\fi
\fi
- \edef\ASYviewportwidth{\ASYviewportwidth}% locally "freeze" viewportwidth
\ifx\ASYviewportwidth\@empty
\ifx\ASYviewportheight\@empty
% write nothing!
@@ -329,25 +328,25 @@
\immediate\write\AsyPreStream{%
\noexpand\InputIfFileExists{%
\ASYprefix\noexpand\jobname-\the\c@asy.pre}{}{}%
- }
+ }%
\asy@write@graphic@header
\IfFileExists{#2.asy}{%
\CatchFileDef\@tempa{#2.asy}{%
\let\do\@makeother
\dospecials
\endlinechar=10\relax
- }
- }{
+ }%
+ }{%
\IfFileExists{#2}{%
\CatchFileDef\@tempa{#2}{%
\let\do\@makeother
\dospecials
\endlinechar=10\relax
- }
- }{
+ }%
+ }{%
\PackageWarning{asymptote}{file #2 not found}%
- }
- }
+ }%
+ }%
\immediate\write\AsyStream{\unexpanded\expandafter{\@tempa}}%
\asy@finalise@stream
\asy@input@graphic
@@ -356,7 +355,7 @@
\newcommand{\ASYanimategraphics}[5][]{%
\IfFileExists{_#3.pdf}{%
\animategraphics[{#1}]{#2}{_#3}{#4}{#5}%
- }{}
+ }{}%
}
\newcommand\asysetup[1]{\setkeys{ASYkeys}{#1}}
\define@key{ASYkeys}{dir}{%
@@ -375,10 +374,7 @@
{\ASYkeepAspecttrue}
{\ASYkeepAspectfalse}%
}
-\def\ASYviewportwidth{\ASYdefaultviewportwidth}
-\def\ASYdefaultviewportwidth{%
- \ifASYattach \@empty \else \the\linewidth \fi
-}
+\def\ASYviewportwidth{}
\define@key{ASYkeys}{viewportwidth}{%
\edef\ASYviewportwidth{\the\dimexpr#1\relax}%
}
diff --git a/Master/tlpkg/asymptote/asy.exe b/Master/tlpkg/asymptote/asy.exe
index 3afb7314158..3bc849c73f0 100755
--- a/Master/tlpkg/asymptote/asy.exe
+++ b/Master/tlpkg/asymptote/asy.exe
Binary files differ