junglemath

package module
v0.5.2-beta Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 9 Imported by: 1

README

Looking for an open source project to get started developing open source for?

Feel free to fork and add whatever math functions you want, including adding some of the "Coming soon??" features!

I do ask that you please use the current format of types and methods when adding new features!

Okay, so what is JungleMath?

JungleMath is a Go library made for doing advanced Math functions. To try it out in action check out JungleCalculator below!

Currently implemented features:

  • Calculator with order of operations
  • Triangle operations
    • Pythagorean theorem
    • Orthocenter
    • Centroid
    • Circumcenter
    • Incenter
  • Radical operations
    • Radical simplification
    • Radical creation (from an integer)
  • Distance calculation
  • New Math types
    • Point
    • Line
    • Triangle
    • Radical
    • Angle

Coming soon??:

  • Trigonometric functions
    • Sine
    • Cosine
    • Tangent
    • Inverse Sine
    • Inverse Cosine
    • Inverse Tangent
    • Cosecant (reciprocal of sine)
    • Secant (reciprocal of cosine)
    • Cotangent (reciprocal of tangent)
  • Calculate Pi to # decimal places

JungleCalculator: https://github.com/junglehornet/jungle-calculator

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetParentheses

func GetParentheses(inpt string) (string, bool)

func IsValidAngleMap

func IsValidAngleMap(m map[string]any) bool

func IsValidLineMap

func IsValidLineMap(m map[string]any) bool

func IsValidPointMap

func IsValidPointMap(m map[string]any) bool

func IsValidTriangle

func IsValidTriangle(t Triangle) bool

func IsValidTriangleMap

func IsValidTriangleMap(m map[string]any) bool

func OpenCalculator

func OpenCalculator()

func PrepEquation

func PrepEquation(equation string) string

func Pythag

func Pythag(leg1, leg2 float64) float64

func Root

func Root(x, y float64) float64

func Solve

func Solve(equation string) float64

func SolveRoots

func SolveRoots(equation string) string

Types

type Angle

type Angle struct {
	A, B, C Point
}

func ToAngle

func ToAngle(m map[string]any, name string) Angle

func (*Angle) Measure

func (a *Angle) Measure() float64

type Line

type Line struct {
	P1, P2 Point
}

func ToLine

func ToLine(m map[string]any, name string) Line

func (*Line) Length

func (l *Line) Length() float64

type Point

type Point struct {
	X, Y, Z float64
}

func ToPoint

func ToPoint(m map[string]any, name string) Point

type Radical

type Radical struct {
	Coef int64
	Rad  float64
}

func CreateRoot

func CreateRoot(inpt float64) (Radical, bool)

func (*Radical) Simplify

func (r *Radical) Simplify() string

type Triangle

type Triangle struct {
	A, B, C Point
}

func ToTriangle

func ToTriangle(m map[string]any, name string) Triangle

func (*Triangle) Centroid

func (t *Triangle) Centroid() Point

func (*Triangle) Circumcenter

func (t *Triangle) Circumcenter() Point

func (*Triangle) Incenter

func (t *Triangle) Incenter() Point

func (*Triangle) Orthocenter

func (t *Triangle) Orthocenter() Point

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL