Skip to content

tp2750/ConstrainedPlanarTriangles.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ConstrainedPlanarTriangles

Stable Dev Build Status

Very primitive package for applying elemetary geometry to find to missing angles or sides in a triangle.

The interface is intuitive, the 3 angles are called A, B, C and the sides lengths a, b, c.

Here are some examples:

julia> triangle(C=90, a=3, b=4)
Dict{Symbol, Vector{Union{Missing, Float64}}} with 2 entries:
  :Sides  => [3.0, 4.0, 5.0]
  :Angles => [36.8699, 53.1301, 90.0]

julia> triangle(C=60, a=4, b=4)
Dict{Symbol, Vector{Union{Missing, Float64}}} with 2 entries:
  :Sides  => [4.0, 4.0, 4.0]
  :Angles => [60.0, 60.0, 60.0]

julia> triangle(a=3, b=3, c=3)
Dict{Symbol, Vector{Union{Missing, Float64}}} with 2 entries:
  :Sides  => [3.0, 3.0, 3.0]
  :Angles => [60.0, 60.0, 60.0]

julia> triangle(A=30, B=60)
Dict{Symbol, Vector{Union{Missing, Float64}}} with 2 entries:
  :Sides  => [missing, missing, missing]
  :Angles => [30.0, 60.0, 90.0]

TODO

  • sine relations: given 2 angles and one opposing side, find other opposing side
    • this solves 3 angles + 1 side
  • use and report heights
  • use and report area
  • parse kwargs in loop
  • update vectors in functions
  • call functions repeatedly until done or give up.
  • report inconsistent. eg triangle(a=1, b=2, c=4)
  • report underdetermined. eg A, B, C
  • relative constrains. Eg B == C or A == B/2.
    • idea: string macro as positional argument: constraint"B == A/2, c == 2b"
  • plot method

About

Solve triangle problems as in highschool.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages