Difference between revisions of "Asymptote: Useful functions"

(Stub stuff: comment)
Line 46: Line 46:
 
draw(x[0] -- x[1],1bp+red);</asy>
 
draw(x[0] -- x[1],1bp+red);</asy>
  
== Stub stuff ==
+
<!--
 
Can someone put a table of contents, and hiding widgets?  
 
Can someone put a table of contents, and hiding widgets?  
 
This page should comprised the most used functions in Asymptote for regular drawings.
 
This page should comprised the most used functions in Asymptote for regular drawings.
 
+
-->
 
[[Category: Asymptote]]
 
[[Category: Asymptote]]

Revision as of 21:46, 15 November 2007

Asymptote (Vector Graphics Language)
Getting Started - Basics - Drawing - Reference - Examples - Macros and Packages - Advanced Asymptote - 3D Graphics - Help

Useful functions - CSE5 Package - How to

This article is a stub. Help us out by expanding it.

Intersection points

function intersectionpoints( path, path) { returns pair[] }

Example:

size(8cm,0);
import math;
import graph;
real r,s;
pair a,b, common;
path circ1, circ2;
r=1; s=1;
a=(0,0);
b=(1,0);
circ1=circle(a,r);
circ2=circle(b,s);
draw(circ1,linewidth(1bp));
draw(circ2,1bp+green);
pair [] x=intersectionpoints(circ1, circ2);
dot(x[0],3bp+blue);
dot(x[1],3bp+blue);
draw(x[0] -- x[1],1bp+red);

[asy]size(200,200); import math; import graph; real r,s; pair a,b, common; path circ1, circ2; r=1; s=1; a=(0,0); b=(1,0); circ1=circle(a,r); circ2=circle(b,s); draw(circ1,linewidth(1bp)); draw(circ2,1bp+green); pair [] x=intersectionpoints(circ1, circ2); dot(x[0],3bp+blue); dot(x[1],3bp+blue); draw(x[0] -- x[1],1bp+red);[/asy]

Invalid username
Login to AoPS