Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Math_Foundations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export nth_root
export calculate_parabola_roots_amrvw, calculate_parabola_roots_polynomial, calculate_parabola_roots_quadratic
# Integrated plotting functions (computation + visualization)
export plot_parabola_roots_amrvw, plot_parabola_roots_polynomial, plot_parabola_roots_quadratic
export plot_hyperbola, plot_hyperbola_axes, plot_hyperbola_axes_varx, plot_hyperbola_axes_direct
export plot_hyperbola, plot_hyperbola_axes_varx, plot_hyperbola_axes_direct
export expa2x
export accrued, accrued_apr
export triangle_area_perim
Expand Down
17 changes: 5 additions & 12 deletions src/basic_maths.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function plot_parabola_roots_quadratic(a₂::Float64, a₁::Float64=0.0, a₀::F
return real_roots
end
"""
plot_parabola(p::Polynomial, r3::Union{Vector{Float64},Vector{ComplexF64}}, a₂::Float64, a₁::Float64, a₀::Float64, str::String)
plot_parabola(p, r3::Union{Vector{Float64},Vector{ComplexF64}}, a₂::Float64, a₁::Float64, a₀::Float64, str::String)
Plot the parabola using the given polynomial and its roots
"""
function plot_parabola(p, r3::Union{Vector{Float64},Vector{ComplexF64}}, a₂::Float64, a₁::Float64, a₀::Float64, str::String)
Expand Down Expand Up @@ -170,14 +170,8 @@ function plot_parabola(p, r3::Union{Vector{Float64},Vector{ComplexF64}}, a₂::F
real_roots
end
"""
plot_hyperbola(n::Integer)
Plot hyperbola with parameter n
"""

"""
p
plot_hyperbola(a::Float64=1.0, h::Float64=0.0, k::Float64=0.0)
Plot hyperbola with equation y = a/(x-h) + b, where a,h and k are scaling parameters
Plot hyperbola with equation y = a/(x-h) + k, where a,h and k are scaling parameters
"""
function plot_hyperbola(a::Float64=1.0, h::Float64=0.0, k::Float64=0.0)
# Define ranges for x, avoiding x - h = 0 where function is undefined
Expand Down Expand Up @@ -273,7 +267,7 @@ exponential function where a > 0 and x is any Real
"""
expa2x(a::Real,x::Real) = a>0 ? a^x : println("a must be a positive real")
"""
function accrued_apr(i::Real,p::Real,c::Int64) -> Float64
accrued_apr(i::Real,p::Real,c::Int64) -> Float64
i is interest, p is period (1 = one year), c is capital
return accrued value using daily apr for interest
"""
Expand All @@ -283,7 +277,7 @@ function accrued_apr(i::Real,p::Real,c::Int64)
c * expa2x(apr,p)
end
"""
function accrued(i::Real,p::Real,c::Int64) -> Float64
accrued(i::Real,p::Real,c::Int64) -> Float64
i is interest, p is period (1 = one year), c is capital
return accrued value
"""
Expand All @@ -293,8 +287,7 @@ end

"""
triangle_area_perim(a::Float64, b::Float64, c::Float64) -> Float64

Calculate ρ, area and perimeter of a triangle using Heron's formula
Calculate ρ, area and perimeter of a triangle using Heron's formula
"""
function triangle_area_perim(a::Float64, b::Float64, c::Float64)
s = (a + b + c) / 2
Expand Down