Universal graphing utility especially useful for locus revision
by Vladislav Titov
Note: due to obscure bug pictures on buttons are sometimes not drawn. If that's the case and you're using Internet Explorer -- press Ctrl-Refresh in your browser until all images are properly loaded.
This is a universal graphing calculator.
Just enter an expression in Expression field. The program then will paint black all points on which the expression evaluates as correct.
Here's some rules that are useful to start writing your own expressions:
-- variable A always represents current point;
-- you can use full range of standart algebraic functions (like sin, cos, tan, exp, pow, sqrt, etc)
-- your expression must evaluate to right/wrong -- i.e. it should use
==, >, <
-- you can combine several comparison operations using logical operations: & -- AND, | -- OR, ! -- NOT
-- you can use assignment operation ( variable = value ) in the end of your expression, separating it by ;
-- precision makes points on screen bigger or smaller
You can chooos a variable in a list and then click on "choose" button and specify it with your mouse in graph area (to specify line -- drag your mouse).
An example of expression -- smiley face, is:
distp (m, point (2, 2)) == 0.5 | distp (m, point (-2, 2)) == 0.7 | (distl (m, line (point(0, -2), point(2, -2))) < 0.5 & distp (m, point (0, -2)) < 1.3);
Full listing of functions follows:
The following types of components are supported:
number n> -- a real number (double)
point p> -- a point consisting of two numbers
line l> -- a line consisting of two points
Following type conversion routines are supported:
point (n>, n>) -- converts two numbers into point (return type: point)
line (p>, p>) -- returns a line starting at point in first parameter, and ending at second
numberx (p>) -- returns a first coordinate of point
numbery (p>) -- returns a second coordinate of point
pointx (l>) -- returns beggining point of line
pointy (l>) -- returns ending point of line
Following operations are permitted on numbers (here operations listed first have lowest precedence and get executed last):
= -- assignment
+, - -- standart arithmetic (return type: number)
*, / -- standart arithmetic (return type: number)
sin(n>), cos(n>) -- sine and cosine in radians (return type: number)
tan(n>), ctan(n>) -- tangens and cotangens in radians (return type: nubmer)
arcsin(n>), arccos(n>)-- inverted sine and cosine in radians (return type: number)
arctan(n>), arcctan(n>)-- inverted tangens and cotangens in radians (return type: number)
ln(n>) -- natural log (return type: nubmer)
exp(n>) -- e^n (return type: number)
sqrt(n>) -- square root (return type: number)
abs(n>) -- absolute value (return type: number)
pow(n1>, n2>) -- returns n1> to the power of n2> (n1>^n2>) (return type: number)
degtrad(n>) -- returns value of n> in radians (return type: number)
radtdeg(n>) -- returns value of n> in degrees (return type: number)
Following operations are permitted on points and lines:
move(p>, l>) -- treats l> as vector, and returns p> dispositioned by this vector (return type: point)
pproj(p>, l>) -- returns a point on the line that is a point of perpendicular projection of p>
perp(p>, l>) -- returns a line that is perpendicular to l> and contains p>; starting point is located on line l>, and end point -- on p>; if p> is located on l>, throws a error
length(l>) -- returns length of the line (between two points) (return type: number)
distp (p>, p>) -- returns distance between two points (return type: number)
distl (p>, l>) -- returns distance between a point and a line (return type: number)
area (p>, l>) -- returns area of triangle which is defined by line (2 vertices) and a point (third vertice)
inter (l>, l>) -- returns point of intersection of two lines
slope (l>) -- returns slope of the line (as tangent)
angle(l>, l>) -- returns an angle between two lines (or exception if they are not intersecting) in radians
invert (l>) -- returns a line that have starting and ending points interchanged
Comparison:
== -- if equal
> -- more - only for numbers
-- less - only for numbers
>= -- to be implemented
= -- to be implemented
Logic operations:
& -- and
| -- or
! -- not
Rules for names of variables:
They can start from letter or '_' character. They can contain letters, '_' characters and numbers. Anything else is not allowed. Variable names are case InSensITIv.