<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
    <name>Construct from Triangle</name>
    <id>effect.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="Generate from Path"/>
        </effects-menu>
    </effect>
    <script>
        <command location="inx" interpreter="python">construct_from_triangle.py</command>
    </script>
</inkscape-extension>
