summaryrefslogtreecommitdiffstats
path: root/share/extensions/draw_from_triangle.inx
blob: 116e3f5860648d6b81185b2789f838878ef81275 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
    <name>Draw From Triangle</name>
    <id>org.inkscape.render.draw_from_triangle</id>
    <param name="tab" type="notebook">
        <page name="common1" gui-text="Common Objects">
            <param name="circumcircle"    type="bool" gui-text="Circumcircle">false</param>
            <param name="circumcentre"    type="bool" gui-text="Circumcentre">false</param>
            <param name="incircle"        type="bool" gui-text="Incircle">false</param>
            <param name="incentre"        type="bool" gui-text="Incentre">false</param>
            <param name="contact_tri"     type="bool" gui-text="Contact Triangle">false</param>
            <param name="excircles"       type="bool" gui-text="Excircles">false</param>
            <param name="excentres"       type="bool" gui-text="Excentres">false</param>
            <param name="extouch_tri"     type="bool" gui-text="Extouch Triangle">false</param>
            <param name="excentral_tri"   type="bool" gui-text="Excentral Triangle">false</param>
            <param name="orthocentre"     type="bool" gui-text="Orthocentre">false</param>
            <param name="orthic_tri"      type="bool" gui-text="Orthic Triangle">false</param>
            <param name="altitudes"       type="bool" gui-text="Altitudes">false</param>
            <param name="anglebisectors"  type="bool" gui-text="Angle Bisectors">false</param>
            <param name="centroid"        type="bool" gui-text="Centroid">false</param>
            <param name="ninepointcentre" type="bool" gui-text="Nine-Point Centre">false</param>
            <param name="ninepointcircle" type="bool" gui-text="Nine-Point Circle">false</param>
            <param name="symmedians"      type="bool" gui-text="Symmedians">false</param>
            <param name="sym_point"       type="bool" gui-text="Symmedian Point">false</param>
            <param name="sym_tri"         type="bool" gui-text="Symmedial Triangle">false</param>
            <param name="gergonne_pt"     type="bool" gui-text="Gergonne Point">false</param>
            <param name="nagel_pt"        type="bool" gui-text="Nagel Point">false</param>
        </page>
        <page name="Custom" gui-text="Custom Points and Options">
            <param name="mode" type="optiongroup" appearance="combo" gui-text="Custom Point Specified By:">
                <option value="trilin">Trilinear Coordinates</option>
                <option value="tcf">Triangle Function</option>
            </param>
            <param name="cust_str"      type="string"  gui-text="Point At:">cos(a_a):cos(a_b):cos(a_c)</param>
            <param name="cust_pt"       type="bool" gui-text="Draw Marker At This Point">false</param>
            <param name="cust_radius"   type="bool" gui-text="Draw Circle Around This Point">false</param>
            <param name="radius"        type="string"  gui-text="Radius (px):">s_a*s_b*s_c/(4*area)</param>
            <param name="isogonal_conj" type="bool" gui-text="Draw Isogonal Conjugate">false</param>
            <param name="isotomic_conj" type="bool" gui-text="Draw Isotomic Conjugate">false</param>
        </page>
        <page name="Help" gui-text="Help">
            <label xml:space="preserve">This extension draws constructions about a triangle defined by the first 3 nodes of a selected path. You may select one of preset objects or create your own ones.
            
All units are the Inkscape's pixel unit. Angles are all in radians.
You can specify a point by trilinear coordinates or by a triangle centre function.
Enter as functions of the side length or angles.
Trilinear elements should be separated by a colon: ':'.
Side lengths are represented as 's_a', 's_b' and 's_c'.
Angles corresponding to these are 'a_a', 'a_b', and 'a_c'.
You can also use the semi-perimeter and area of the triangle as constants. Write 'area' or 'semiperim' for these.

You can use any standard Python math function:
ceil(x); fabs(x); floor(x); fmod(x,y); frexp(x); ldexp(x,i); 
modf(x); exp(x); log(x [, base]); log10(x); pow(x,y); sqrt(x); 
acos(x); asin(x); atan(x); atan2(y,x); hypot(x,y); 
cos(x); sin(x); tan(x); degrees(x); radians(x); 
cosh(x); sinh(x); tanh(x)

Also available are the inverse trigonometric functions:
sec(x); csc(x); cot(x)

You can specify the radius of a circle around a custom point using a formula, which may also contain the side lengths, angles, etc. You can also plot the isogonal and isotomic conjugate of the point. Be aware that this may cause a divide-by-zero error for certain points.
            </label>
        </page>
    </param>
    <effect>
        <object-type>all</object-type>
        <effects-menu>
            <submenu name="Render"/>
        </effects-menu>
    </effect>
    <script>
        <command location="inx" interpreter="python">draw_from_triangle.py</command>
    </script>
</inkscape-extension>