Skip to content

Commit d8b61d5

Browse files
committed
ups
1 parent 4040aad commit d8b61d5

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

src/JTools.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ export plotBox, plotBox!, lines3!, scatter3!, multilines!, plotSphere!, plotSens
4343
export plotCorrelation, plotCorrelation!
4444
include("functions/makieTools.jl")
4545

46-
export crossmat, logrange, unwrap!, modd, isMultiple, signum
47-
export polyfit, polyval, interp1, mul3x1!, mul3x3!
46+
export crossmat, unwrap!, modd, isMultiple, signum #, logrange
47+
export polyfit, polyval, interp1, mul3x1!, mul3x3!, evalpoly!
4848
include("functions/math.jl")
4949

5050
export lsq, lsqWeight

src/functions/math.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@inline crossmat(v) = [0.0 -v[3] v[2]; v[3] 0.0 -v[1]; -v[2] v[1] 0.0];
2-
@inline logrange(a, b, length=100) = exp10.(range(a; stop=b, length=length))
2+
# @inline logrange(a, b, length=100) = exp10.(range(a; stop=b, length=length))
33

44
@inline function unwrap!(x, period=2π)
55
y = convert(eltype(x), period)
@@ -46,6 +46,16 @@ end
4646
return y
4747
end
4848

49+
function evalpoly!(y::Vector{T}, t::T, C) where T
50+
y .= C[1]
51+
tk = T(1)
52+
@inbounds for i in 2:lastindex(C)
53+
tk *= t
54+
y .+= C[i].*tk
55+
end
56+
return
57+
end
58+
4959
@inline function interp1(x, y, xi)
5060
if xi x[end]
5161
return y[end]

src/functions/units.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@ module Units
33
m = 1.0
44
cm = 1e-2
55
mm = 1e-3
6+
μm = 1e-6
67
km = 1e3
78
ft = 0.3048
89
inch = 0.0254
910

1011
# Time
1112
s = 1.0
1213
ms = 1e-3
14+
μs = 1e-6
1315
min = 60.0
1416
hr = 3600.0
1517
hrs = 3600.0
@@ -34,6 +36,7 @@ kg = 1.0
3436
N = 1.0
3537
kN = 1e3
3638
mN = 1e-3
39+
μN = 1e-6
3740

3841
# Angular rate
3942
rpm = 2π/min
@@ -49,6 +52,7 @@ ng = g*1e-9
4952
# Frequency
5053
Hz = 1.0
5154
mHz = 1e-3
55+
μHz = 1e-6
5256
kHz = 1e3
5357

5458
# Constants

0 commit comments

Comments
 (0)