[ADD] file to understand packages and Volume as an example
This commit is contained in:
parent
85689260e7
commit
7eee98ece2
|
@ -1,5 +1,5 @@
|
||||||
workspace()
|
workspace()
|
||||||
push!(LOAD_PATH, "/Users/eddie/Documents/Programming/Julia")
|
push!(LOAD_PATH, ".")
|
||||||
using Volume
|
using Volume
|
||||||
|
|
||||||
println(LOAD_PATH)
|
println(LOAD_PATH)
|
||||||
|
|
|
@ -8,15 +8,15 @@ sphere_volume(r) = (4/3)*π*r^3
|
||||||
"Volume of cylinder with radius `r` and height `h`"
|
"Volume of cylinder with radius `r` and height `h`"
|
||||||
cylinder_volume(r,h) = circle_area(r)*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`"
|
"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"
|
"Area of a triangle"
|
||||||
trianle_area(b,h) = b*h/2
|
trianle_area(b,h) = b*h/2
|
||||||
|
|
||||||
"Area of circle with radius `r`"
|
|
||||||
circle_area(r) = π*r^2
|
|
||||||
|
|
||||||
"Rectangle area"
|
"Rectangle area"
|
||||||
rectangle_area(h,w) = h*w
|
rectangle_area(h,w) = h*w
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue