[ADD] file to understand packages and Volume as an example

This commit is contained in:
Eduardo Cueto Mendoza 2020-05-11 10:32:46 -06:00
parent 85689260e7
commit 7eee98ece2
2 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
workspace()
push!(LOAD_PATH, "/Users/eddie/Documents/Programming/Julia")
push!(LOAD_PATH, ".")
using Volume
println(LOAD_PATH)

View File

@ -8,15 +8,15 @@ sphere_volume(r) = (4/3)*π*r^3
"Volume of cylinder with radius `r` and height `h`"
cylinder_volume(r,h) = circle_area(r)*h
"Area of circle with radius `r`"
circle_area(r) = π*r^2
"Surface area of a cylinder of height `h` and radius `r`"
cylinder_area(r) = 2*circle_area(r) + 2*π*r*h
cylinder_area(r,h) = 2*circle_area(r) + 2*π*r*h
"Area of a triangle"
trianle_area(b,h) = b*h/2
"Area of circle with radius `r`"
circle_area(r) = π*r^2
"Rectangle area"
rectangle_area(h,w) = h*w