No description
Find a file
Thiago Navarro 498ecad0c6 fix readme
2021-09-17 01:03:13 +00:00
docs Version 0.1.1 2021-09-17 01:00:17 +00:00
example Version 0.1.1 2021-09-17 01:00:17 +00:00
src Version 0.1.1 2021-09-17 01:00:17 +00:00
tests Version 0.1.1 2021-09-17 01:00:17 +00:00
.gitignore Version 0.1.1 2021-09-17 01:00:17 +00:00
changelog.md Version 0.1.1 2021-09-17 01:00:17 +00:00
formulas.nimble Version 0.1.1 2021-09-17 01:00:17 +00:00
licence Added MIT license 2021-06-15 13:46:42 -03:00
readme.md fix readme 2021-09-17 01:03:13 +00:00

Formulas

Formulas is a Nim library that helps you calculate areas, volumes, edges, etc...

Supports version 1.0.0 of Nim!

Now with configurable PI value!

More formulas will be added soon


Tetrahedron

  • area
  • edge
  • height
  • volume

Example (example/tetrahedron.nim):

import formulas

var tetrahedron = initTetrahedron(edge = 10)

echo tetrahedron.area() # +- 173.2
echo tetrahedron.height() # +- 8.1
echo tetrahedron.volume() # +- 117.8

tetrahedron.volume = 117.85113019775793 # same as tetrahedron.volume()
tetrahedron.edge = 0

echo tetrahedron.edge() # 10

Cone

  • slant height
  • side area
  • total area
  • volume
  • radius
  • height

Example (example/cone.nim):

import formulas

var cone = initCone(height = 10, radius = 8)

echo cone.slant() # 12.8

cone.slant = cone.slant() # set the slant value to the calculated one

echo cone.volume() # +- 670.2
echo cone.totalArea() # +- 522.9
echo cone.sideArea() # 321.8

cone.volume = cone.volume()
cone.radius = 0

echo cone.radius() # 8

cone.radius = 8
cone.height = 0

echo cone.height() # 10

Docs

The documentation can be found in Github pages

TODO

  • Change the nimble package url from gitea to github

License

MIT