/GeoMath

:blue_square: :large_blue_diamond: :large_blue_circle: Geometric Math for any shapes. project made for study the Rust Lang.

Primary LanguageRustMIT LicenseMIT

GeoMath

GEOMETRIC MATH

WIKIDOCSUSAGE

formulas

CodeFactor

Usage

if you type

geo-math --help

you will see the help menu, something like this

Help Code

GeoMath have support of seven shapes:

circle - parallelogram - rectangle - rhombus - square - trapezoid - triangle

you can type geo-math [shape] --help to get the help menu of each geometry

Circle

circle

FEATURES

  • get area

    usage: geo-math circle --raio=[THE RAIO OF CIRCLE] [ACTION]

    e.g:

    $ geo-math circle --raio=5 -a
    
    49.34802200544679cm

Square, Rectangle and Parallelogram

square rectangle parallelogram

all this shapes uses the same formula

FEATURES

  • get area

    usage: geo-math [command] --base=[THE BASE OF THE SHAPE] --height=[THE HEIGHT OF THE SHAPE] [ACTION]

    e.g:

    $ geo-math square --base=5 --height=5 -a
    
    25cm

Rhombus

rhombus

FEATURES

  • get area

    usage: geo-math rhombus --lDiagonal=[LARGER DIAGONAL] --sDiagonal=[SMALLER DIAGONAL] [ACTION]

    e.g:

    $ geo-math rhombus --lDiagonal=42 --sDiagonal=42 -a
    
    882cm

Trapezoid

trapezoid

FEATURES

  • get area

    usage: geo-math circle --lBase=[LARGER BASE] --sBase=[SMALLER BASE] --height=[THE HEIGHT OF SHAPE] [ACTION]

    e.g:

    $ geo-math trapezoid --lBase=42 --sBase=42 --height=42 -a
    
    1764cm 

Triangle

triangle

FEATURES

  • get area

    using base and height: geo-math triangle --base=[THE BASE OF TRIANGLE] --height=[HEIGHT OF TRIANGLE] -a

    e.g:

    $ geo-math triangle --base=42 --height=42 -a
    
    882cm 

    using sides: geo-math triangle --side-a=[SIDE A] --side-b=[SIDE B] --side-c=[SIDE C] -a

    e.g:

    $ geo-math triangle --side-a=42 --side-b=42 --side-c=42 -a
    
    763.8344cm
  • get perimeter

    usage: geo-math triangle --side-a=[SIDE A] --side-b=[SIDE B] --side-c=[SIDE C] -p

    e.g:

    $ geo-math triangle --side-a=42 --side-b=42 --side-c=42 -p
    
    63cm