Verctor graphics showing a fraction of circle
Source code name: "tech_unicircle.py"
Programming language: Python
Topic: Graphics/Technical
DMelt Version 1.4. Last modified: 02/08/1971. License: Free
http://datamelt.org/code/cache/tech_unicircle_8393.py
To run this script using the DMelt IDE, copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.


from jhplot import *
from net.sf.drawj2d import Drawj2d

f="drawing.hcl"
out="drawing.svg"

s="""
unitlength [/ 1. 40.] m

set O {0 0}
set r 1
set T -30

set R [geom.polar 0]
set P [geom.polar $T]

m $O
pen lightgray
fillsector $r $T 0
pen black 0.3
circle $r
line $R $O $P
dot $O
dot $R
tlb "([nf [X $R] 0], [nf [Y $R] 0])" E
dot $P

"""

with open(f, "w") as xfile:
    xfile.write(s)

args=["-T" "svg", "-W", "60", "-H", "40", "-o", out, f]
Drawj2d.Run(args)
IViewSVG(out)