Skip to content

Commit

Permalink
Merge pull request andmarti1424#396 from earthshrink/greek_engfmt_doc
Browse files Browse the repository at this point in the history
Greek engfmt doc
  • Loading branch information
andmarti1424 authored Apr 10, 2020
2 parents a577206 + faa25ee commit b4ab511
Show file tree
Hide file tree
Showing 3 changed files with 230 additions and 2 deletions.
61 changes: 60 additions & 1 deletion src/doc
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,64 @@ Commands for handling cell content:
The c-d command, used in Normal and Visual modes, acts as the :datefmt
described above, but uses the locale's D_FMT format.

==============================================================================
&NUMBER FORMATS&

Numbers follow cell-specific format if set by the :format command.
Otherwise they default to column specific format, which can be set by the
scripting command FORMAT. The scripting FORMAT command has the syntax
FORMAT {COLUMN} {WIDTH} {PRECISION} {TYPE}
where TYPE is one of:
0 Fixed-point
1 Scientific format
2 Engineering format
The default column format is (10 2 0), meaning width 10, precision 2, and
fixed-point. The column format width follows changes to the column width.

Note: If the exponent is too large (>10^21) or too small (<10^-18), the
scientific format is used.

==============================================================================
&Entering Greek and Math operator symbols&

Greek letters and a large set of math symbols available in UTF-8
can be entered and will display, provided your terminal supports them.

The full list is given below. In each column, left of the equal sign is
the keyboard sequence to be entered, to obtain the character on the right
of the equal sign.

Ctrl-K a * = α Ctrl-K b * = β Ctrl-K c * = ξ Ctrl-K d * = δ
Ctrl-K e * = ε Ctrl-K f * = φ Ctrl-K g * = γ Ctrl-K h * = θ
Ctrl-K i * = ι Ctrl-K j * = ϊ Ctrl-K k * = κ Ctrl-K l * = λ
Ctrl-K m * = μ Ctrl-K n * = ν Ctrl-K o * = ο Ctrl-K p * = π
Ctrl-K q * = ψ Ctrl-K r * = ρ Ctrl-K s * = σ Ctrl-K t * = τ
Ctrl-K u * = υ Ctrl-K v * = ϋ Ctrl-K w * = ω Ctrl-K x * = χ
Ctrl-K y * = η Ctrl-K z * = ζ

Ctrl-K A * = Α Ctrl-K B * = Β Ctrl-K C * = Ξ Ctrl-K D * = Δ
Ctrl-K E * = Ε Ctrl-K F * = Φ Ctrl-K G * = Γ Ctrl-K H * = Θ
Ctrl-K I * = Ι Ctrl-K J * = Ϊ Ctrl-K K * = Κ Ctrl-K L * = Λ
Ctrl-K M * = Μ Ctrl-K N * = Ν Ctrl-K O * = Ο Ctrl-K P * = Π
Ctrl-K Q * = Ψ Ctrl-K R * = Ρ Ctrl-K S * = Σ Ctrl-K T * = Τ
Ctrl-K U * = Υ Ctrl-K V * = Ϋ Ctrl-K W * = Ω Ctrl-K X * = Χ
Ctrl-K Y * = Η Ctrl-K Z * = Ζ

Ctrl-K * s = ς Ctrl-K R T = √ Ctrl-K F A = ∀ Ctrl-K T E = ∃
Ctrl-K N B = ∇ Ctrl-K ( - = ∈ Ctrl-K - ) = ∋ Ctrl-K d P = ∂
Ctrl-K I n = ∫ Ctrl-K I o = ∮ Ctrl-K D I = ∬ Ctrl-K * P = ∏
Ctrl-K + Z = ∑ Ctrl-K + - = ± Ctrl-K - + = ∓ Ctrl-K 0 ( = ∝
Ctrl-K 0 0 = ∞ Ctrl-K - L = ∟ Ctrl-K - V = ∠ Ctrl-K P P = ∥
Ctrl-K A N = ∧ Ctrl-K O R = ∨ Ctrl-K ) U = ∪ Ctrl-K ( U = ∩
Ctrl-K ) C = ⊃ Ctrl-K ( C = ⊂ Ctrl-K ) _ = ⊇ Ctrl-K ( _ = ⊆
Ctrl-K . : = ∴ Ctrl-K . : = ∴ Ctrl-K : . = ∵ Ctrl-K ? - = ≃
Ctrl-K ? - = ≃ Ctrl-K ! = = ≠ Ctrl-K = 3 = ≡ Ctrl-K = < = ≤
Ctrl-K > = = ≥ Ctrl-K < * = ≪ Ctrl-K > * = ≫ Ctrl-K ! < = ≮
Ctrl-K ! > = ≯

Note: It is possible to enter these characters also in the command mode,
but your OS may not support filenames containing them.

==============================================================================
&Other configuration variables&

Expand Down Expand Up @@ -1725,4 +1783,5 @@ Commands for handling cell content:
NEWLINE_ACTION = {NUMBER}
TM_GMTOFF
TM_GMTOFF = {num}
vim:tw=78:ts=8:ft=help:norl:

vim:tw=78:sw=4:ts=4:et:ft=help:norl:
2 changes: 1 addition & 1 deletion src/format.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ int engformat(int fmt, int width, int lprecision, double val, char *buf, int buf
if ((engabs >= 1e18) && (engabs < 1e21 )) engind=12;
if ((engabs < 1e-18) || (engabs >= 1e21 )) {
/* Revert to floating point */
(void) sprintf(buf,"%*.*E", width, lprecision, val);
(void) sprintf(buf,"%*.*e", width, lprecision, val);
} else {
engexp = (double) (engind-6)*3;
engmant = val/pow(10.0e0,engexp);
Expand Down
169 changes: 169 additions & 0 deletions tests/gps.sc
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# This data file was generated by the Spreadsheet Calculator. That is SC-IM, the improved one!
# You almost certainly shouldn't edit it.

format A 11 2 0
format B 28 2 0
format C 21 2 0
format D 12 2 2
format F 12 2 2
mark a B37 G38
mark b A1
mark c A1
mark d A1
mark e A1
mark f A1
mark g A1
mark h A1
mark i A1
mark j A1
mark k A1
mark l A1
mark m A1
mark n A1
mark o A1
mark p A1
mark q A1
mark r A1
mark s A6 G6
mark t A1
mark u A1
mark v A1
mark w A1
mark x D4
mark y A1
mark z A1
leftstring A0 = "Constants"
leftstring B1 = "Speed of light"
label C1 = "c"
let D1 = F1/1000
label E1 = "km/s"
let F1 = 299492458
label G1 = "m/s"
leftstring B2 = "Gravitational const"
label C2 = "G"
let F2 = 6.67408e-11
label G2 = "N/kg"
leftstring B3 = "Mass of Earth"
label C3 = "m_E"
let F3 = 5.972e+24
label G3 = "kg"
leftstring B4 = "Mean radius of Earth"
label C4 = "r_e"
let D4 = 6400
label E4 = "km"
let F4 = D4*1000
label G4 = "m"
leftstring A6 = "GPS signal"
leftstring B6 = "https://en.wikipedia.org/wiki/GPS_signals"
leftstring B7 = "L-band base (IF)"
label C7 = "ω_i"
let D7 = 10.23
label E7 = "MHz"
let F7 = D7*1000000
label G7 = "Hz"
leftstring B8 = "L1 carrier"
label C8 = "ω_1"
let D8 = D7*154
label E8 = "MHz"
let F8 = D8*1000000
label G8 = "Hz"
leftstring B9 = "L2 carrier"
label C9 = "ω_2"
let D9 = D7*120
label E9 = "MHz"
let F9 = D9*1000000
label G9 = "Hz"
leftstring B10 = "L3 carrier"
label C10 = "ω_3"
let D10 = D7*135
label E10 = "MHz"
let F10 = D10*1000000
label G10 = "Hz"
leftstring B11 = "L4 carrier"
label C11 = "ω_4"
let D11 = D7*1214/9
label E11 = "MHz"
let F11 = D11*1000000
label G11 = "Hz"
leftstring B12 = "L5 carrier"
label C12 = "ω_5"
let D12 = D7*115
label E12 = "MHz"
let F12 = D12*1000000
label G12 = "Hz"
leftstring B14 = "IF period"
label C14 = "τ_i"
let D14 = F14*1000000000
label E14 = "ns"
let F14 = 1/F7
label G14 = "Hz"
leftstring A16 = "Orbit"
leftstring B16 = "https://en.wikipedia.org/wiki/Global_Positioning_System"
leftstring B17 = "Min range"
label C17 = "r_min"
let D17 = 20180
label E17 = "km"
let F17 = D17*1000
label G17 = "m"
leftstring B18 = "Orbit radius"
label C18 = "r_o = r_min+r_e"
let D18 = F18/1000
label E18 = "km"
let F18 = F17+F$4
label G18 = "m"
leftstring B19 = "Max range (at horizon)"
label C19 = "r_max=√(r_o^2-r_e^2)"
let D19 = F19/1000
label E19 = "km"
let F19 = @sqrt(F18*F18-F$4*F$4)
label G19 = "m"
leftstring B21 = "Light time min"
label C21 = "r_min/c"
let D21 = F21*1000
label E21 = "ms"
let F21 = F17/$F$1
label G21 = "s"
leftstring B22 = "Light time"
label C22 = "r_max/c"
let D22 = F22*1000
label E22 = "ms"
let F22 = F19/$F$1
label G22 = "s"
leftstring B24 = "Orbital speed"
label C24 = "v_o = √(G.m_E/r_o)"
let D24 = F24*3600/1000
label E24 = "km/h"
let F24 = @sqrt(F$2*F$3/F18)
label G24 = "m/s"
leftstring B26 = "sin∠(horizon,Earth centre)"
label C26 = "sin θ = r_e/r_o"
let F26 = F$4/F18
leftstring B27 = "Range rate at horizon"
label C27 = "v_h=v_o sin θ"
let D27 = F27*3600/1000
label E27 = "km/h"
let F27 = F24*F26
label G27 = "m/s"
leftstring A29 = "Max Doppler"
leftstring B30 = "Fractional Doppler"
label C30 = "z = v_h/c"
let F30 = F27/F$1
leftstring B31 = "L1 shift"
label C31 = "z.ω_1"
let D31 = D8*F$30*1000
label E31 = "kHz"
let F31 = D31*1000
label G31 = "Hz"
leftstring B32 = "L2 shift"
label C32 = "z.ω_2"
let D32 = D9*F$30*1000
label E32 = "kHz"
let F32 = D32*1000
label G32 = "Hz"
cellcolor A0 "fg=BLACK bg=CYAN"
cellcolor A6 "fg=BLACK bg=CYAN"
cellcolor B6:G6 "fg=BLACK bg=YELLOW"
cellcolor A16 "fg=BLACK bg=CYAN"
cellcolor B16:G16 "fg=BLACK bg=YELLOW"
cellcolor A29 "fg=BLACK bg=CYAN"
goto A35

0 comments on commit b4ab511

Please sign in to comment.