#! mavscript-yacas TEMPLATE.html
Requires Drawj2d

Mavscript and graphs - using HTML and Drawj2d

Drawj2d creates technical line drawings using a descriptive language.

Like Mavscript, it runs on all platforms that run Java. It is actually written by the same author.

Example

Input
-----

Length          §m Δl := 10.3 §i m
Hight           §m Δh :=  3.2 §i m


Calculation
-----------

§m A := Δl*Δh §i = §m % §o m²
§m α :~ ArcTan(Δh / Δl) * 180/Pi §i = §m nf(%,3) §o°


Results
-------

The area of the rectangle is §m nf(A, 1) §o m².
§m SetVar(dwg, {"Δl", "Δh", "A"}) §n §m SetVar(dwg, {"α"}) §n §m Att(dwg, "unitlength [/ 1000 200.]; # 1:200 ") §n §m Att("set O {0 0} ") §n §m Att("set B \"$Δl 0\" ") §n §m Att("set C \"$Δl $Δh\" ") §n §m Att("set D \"0 $Δh\" ") §n §m Att("moveto $B; label B ") §n §m Att("moveto $C; label C SE ") §n §m Att("moveto $D; label D SW ") §n §m Att("moveto $O; label O NW ") §n §m Att("rectangle $Δl $Δh ") §n §m Att("pen 0.35 ") §n §m Att("moverel [mm 0 -12] ") §n §m Att("dimlinerel $Δl 0 ") §n §m Att("moveto $B; moverel [mm 12 0] ") §n §m Att("dimlinerel 0 $Δh ") §n §m Att("moveto $D ") §n §m Att("label \"A = $A m²\" ") §n §m Att("pen blue ") §n §m Att("arrow $O $C ") §n §m Att("dimangle $O $B $C ") §n §m Drawj2d(dwg, "4-drawj2d-drawing_auto", "-T svg -r 96 -W 100 -H 50 -X 20 -Y 25") §n

The rectangle, 1:200