Skip to content

Commit

Permalink
Added vectors and matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
Proektsoftbg committed Sep 30, 2024
1 parent 6a4c09e commit b96a897
Show file tree
Hide file tree
Showing 244 changed files with 61,573 additions and 7,013 deletions.
2 changes: 1 addition & 1 deletion Calcpad.Cli/Calcpad.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<LangVersion>latest</LangVersion>
<AnalysisLevel>latest</AnalysisLevel>
<RootNamespace>Calcpad.Cli</RootNamespace>
<Version>6.2.4</Version>
<Version>7.0.7</Version>
<Authors>Nedelcho Ganchovski</Authors>
<Company>Proektsoft EOOD</Company>
<PackageId>Cli</PackageId>
Expand Down
4 changes: 2 additions & 2 deletions Calcpad.Cli/Calcpad.Cli.sln
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Global
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {5D93901C-866B-4C32-8C0B-82043F741733}
RESX_AutoCreateNewLanguageFiles = True
RESX_ConfirmAddLanguageFile = True
RESX_AutoCreateNewLanguageFiles = True
SolutionGuid = {5D93901C-866B-4C32-8C0B-82043F741733}
EndGlobalSection
EndGlobal
151 changes: 151 additions & 0 deletions Calcpad.Cli/HELP.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
————————————————————————————————————————————————————————————————————————————————
Commands:
————————————————————————————————————————————————————————————————————————————————
NEW - clear the current session and start a new one;
OPEN - open a stored problem from the disk;
SAVE - save the current problem to the disk;
LIST - list the available problems on the disk;
EXIT - close the program;
RESET - clear the output and re-calculate everything from the start;
CLS - clear the output and continue from the last line;
DEL - delete the last line;
DEG - set default trigonometric units to degrees;
RAD - set default trigonometric units to radians;
GRA - set default trigonometric units to grades;
SETTINGS/OPTIONS - display the settings file for editing;
LICENSE - display the license file;
HELP - show this help file.

————————————————————————————————————————————————————————————————————————————————
Operators: ! ^ / ÷ \ % * - + ≡ ≠ < > ≤ ≥ ∧ ∨ ⊕ = ? (input field)
————————————————————————————————————————————————————————————————————————————————
Custom functions: f(x; y; z…) = expression
————————————————————————————————————————————————————————————————————————————————
Functions:
————————————————————————————————————————————————————————————————————————————————
sin(x) cos(x) tan(x) csc(x) sec(x) cot(x)
asin(x) acos(x) atan(x) acsc(x) asec(x) acot(x)
sinh(x) cosh(x) tanh(x) csch(x) sech(x) coth(x)
asinh(x) acosh(x) atanh(x) acsch(x) asech(x) acoth(x)
log(x) ln(x) log_2(x) exp(x)
sqr(x) sqrt(x) cbrt(x) root(x; n)
round(x) floor(x) ceiling(x) trunc(x)
sign(x) mod(x; y) gcd(x; y) lcm(x; y) atan2(x; y)
abs(x) re(x) im(x) phase(x) random(x)
and(x; y; z…) or(x; y; z…) xor(x; y; z…) not(x)
min(x; y; z…) max(x; y; z…)
sum(x; y; z…) average(x; y; z…) sumsq(x; y; z…)
product(x; y; z…) mean(x; y; z…) srss(x; y; z…)
if(cond; val-if-true; val-if-false)
switch(cond1; val1; cond2; val2; …; default)
take(n; a; b; c…) line(x; a; b; c…) spline(x; a; b; c…)

————————————————————————————————————————————————————————————————————————————————
Iterative and numerical methods:
————————————————————————————————————————————————————————————————————————————————
$Root{f(x) = const @ x = a : b}
$Root{f(x) @ x = a : b}
$Find{f(x) @ x = a : b}
$Sup{f(x) @ x = a : b}
$Inf{f(x) @ x = a : b}
$Area{f(x) @ x = a : b}
$Integral{f(x) @ x = a : b}
$Slope{f(x) @ x = a}
$Sum{f(k) @ k = a : b}
$Product{f(k) @ k = a : b}
$Repeat{f(k) @ k = a : b}
Precision

————————————————————————————————————————————————————————————————————————————————
Units of measurement:
————————————————————————————————————————————————————————————————————————————————
Dimensionless: % ‰
Angles: ° ′ ″ deg rad grad rev

Metric (SI and compatible):
Mass: g hg kg t kt Mt Gt dg cg mg μg Da u
Length: m km dm cm mm μm nm pm AU ly
Time: s ms μs ns ps min h d w y
Frequency: Hz kHz MHz GHz THz mHz μHz nHz pHz rpm
Speed: kmh
Electric current: A kA MA GA TA mA μA nA pA
Temperature: °C Δ°C K
Amount of substance: mol
Luminous intensity: cd
Area: a daa ha
Volume: L daL hL dL cL mL μL nL pL
Force: N daN hN kN MN GN TN gf kgf tf dyn
Moment: Nm kNm
Pressure: Pa daPa hPa kPa MPa GPa TPa dPa cPa mPa μPa nPa pPa
bar mbar μbar atm at Torr mmHg
Viscosity: P cP St cSt
Energy work: J kJ MJ GJ TJ mJ μJ nJ pJ
Wh kWh MWh GWh TWh mWh μWh nWh pWh
eV keV MeV GeV TeV PeV EeV cal kcal erg
Power: W kW MW GW TW mW μW nW pW hpM ks
VA kVA MVA GVA TVA mVA μVA nVA pVA
VAR kVAR MVAR GVAR TVAR mVAR μVAR nVAR pVAR
Electric charge: C kC MC GC TC mC μC nC pC Ah mAh
Potential: V kV MV GV TV mV μV nV pV
Capacitance: F kF MF GF TF mF μF nF pF
Resistance: Ω kΩ MΩ GΩ TΩ mΩ μΩ nΩ pΩ
Conductance: S kS MS GS TS mS μS nS pS
℧ k℧ M℧ G℧ T℧ m℧ μ℧ n℧ p℧
Magnetic flux: Wb kWb MWb GWb TWb mWb μWb nWb pWb
Magn. flux density: T kT MT GT TT mT μT nT pT
Inductance: H kH MH GH TH mH μH nH pH
Luminous flux: lm
Illuminance: lx
Radioactivity: Bq kBq MBq GBq TBq mBq μBq nBq pBq Ci Rd
Absorbed dose: Gy kGy MGy GGy TGy mGy μGy nGy pGy
Equivalent dose: Sv kSv MSv GSv TSv mSv μSv nSv pSv
Catalytic activity: kat

Non-metric (Imperial/US):
Mass: gr dr oz lb (lbm, lb_m) kipm (kip_m) st qr
cwt (cwt_UK, cwt_US) ton (ton_UK, ton_US) slug
Length: th in ft yd ch fur mi ftm (ftm_UK, ftm_US)
cable (cable_UK, cable_US) nmi li rod pole perch lea
Speed: mph knot
Temperature: °F Δ°F °R
Area: rood ac
Volume, fluid: fl_oz gi pt qt gal bbl
fl_oz_UK gi_UK pt_UK qt_UK gal_UK bbl_UK
fl_oz_US gi_US pt_US qt_US gal_US bbl_US
Volume, dry: pt_dry qt_dry gal_dry bbl_dry
pk (pk_UK, pk_US) bu (bu_UK, bu_US)
Force: ozf (oz_f) lbf (lb_f) kip (kipf, kip_f) tonf (ton_f) pdl
Pressure: osi osf psi psf ksi ksf tsi tsf inHg
Energy/work: BTU therm (therm_UK, therm_US) quad
Power: hp hpE hpS

————————————————————————————————————————————————————————————————————————————————
Special symbol conversion table:
————————————————————————————————————————————————————————————————————————————————
(add apostrophe ` before the respective latin letter)

Fr: `a `b `c `d `e `f `g `h `i `j `k `l `m `n `o `p `q `r `s `t `u `v `w `x `y `z
To: α β χ δ ε φ γ η ι ø κ λ μ ν ο π θ ρ σ τ υ ϑ ω ξ ψ ζ

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

Fr: `@ `' (single quote) `" (double quote)
To: ° ′ (single prime) ″ (double prime/second)

————————————————————————————————————————————————————————————————————————————————
Command line options (support the same language features as Calcpad.exe):
————————————————————————————————————————————————————————————————————————————————
cli input.cpd output.html - calculates input.cpd and exports
cli input.cpd output.docx the results to the respective format
cli input.cpd output.pdf (html, docx or pdf);

cli input.cpd html - calculates input.cpd and exports to input.html;
cli input.cpd docx - calculates input.cpd and exports to input.docx;
cli input.cpd pdf - calculates input.cpd and exports to input.pdf;

cli input.cpd - calculates input.cpd and exports to input.html.

Additional arguments:
-s - silent mode (do not open the output file), e.g.:
cli input.cpd output.html -s
22 changes: 22 additions & 0 deletions Calcpad.Cli/LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

MIT License

Copyright (c) 2023 Ned Ganchovski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
22 changes: 20 additions & 2 deletions Calcpad.Cli/Messages.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions Calcpad.Cli/Messages.bg.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Welcome_To_Calcpad_Command_Line_Interpreter" xml:space="preserve">
<value> Добре дошли в командния интерпретатор на Calcpad v.{0}.{1}.{2}!</value>
<value> Добре дошли в командния интерпретатор на Calcpad VM {0}.{1}.{2}!</value>
</data>
<data name="Press_Any_Key_When_Ready" xml:space="preserve">
<value>Натиснете произволен клавиш за да продължите.</value>
</data>
<data name="Copyright_2023_By_Proektsoft_EOOD" xml:space="preserve">
<value> © 2023 Проектсофт ЕООД. Всички права запазени.</value>
<value> © 2024 Проектсофт ЕООД. Всички права запазени.</value>
</data>
<data name="Commands" xml:space="preserve">
<value>Команди</value>
Expand All @@ -147,4 +147,10 @@
<data name="Loading_The_Settings_File" xml:space="preserve">
<value>Отваряне на файл с настройки...</value>
</data>
<data name="WouldYouLikeToRestoreThePreviousSettingsYN" xml:space="preserve">
<value>Желаете ли да възстановите предишните настройки (да/не)?</value>
</data>
<data name="PressAnyKeyToContinue" xml:space="preserve">
<value>Натиснете произволен клавиш, за да продължите.</value>
</data>
</root>
10 changes: 8 additions & 2 deletions Calcpad.Cli/Messages.resx
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Welcome_To_Calcpad_Command_Line_Interpreter" xml:space="preserve">
<value> Welcome to Calcpad command line interpreter v.{0}.{1}.{2}!</value>
<value> Welcome to Calcpad VM command line interpreter v.{0}.{1}.{2}!</value>
</data>
<data name="Press_Any_Key_When_Ready" xml:space="preserve">
<value>Press any key when ready.</value>
</data>
<data name="Copyright_2023_By_Proektsoft_EOOD" xml:space="preserve">
<value> Copyright: © 2023 by Proektsoft EOOD.</value>
<value> Copyright: © 2024 by Proektsoft EOOD.</value>
</data>
<data name="Commands" xml:space="preserve">
<value>Commands</value>
Expand All @@ -147,4 +147,10 @@
<data name="Loading_The_Settings_File" xml:space="preserve">
<value>Loading the settings file...</value>
</data>
<data name="WouldYouLikeToRestoreThePreviousSettingsYN" xml:space="preserve">
<value>Would you like to restore the previous settings (y/n)?</value>
</data>
<data name="PressAnyKeyToContinue" xml:space="preserve">
<value>Press any key to continue.</value>
</data>
</root>
6 changes: 3 additions & 3 deletions Calcpad.Cli/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ static Settings GetSettings()
catch (Exception ex)
{
fileStream?.Close();
var key = WriteErrorAndWait(ex.Message, "Would you like to restore the previous settings (y/n)?");
var key = WriteErrorAndWait(ex.Message, Messages.WouldYouLikeToRestoreThePreviousSettingsYN);
if (key.Key == ConsoleKey.Y)
TryRestoreSettings(settings, writer, path);
}
Expand Down Expand Up @@ -369,7 +369,7 @@ static bool TryConvertOnStartup(Settings settings)
private static ConsoleKeyInfo WriteErrorAndWait(string message, string prompt = null)
{
WriteError(message, true);
prompt ??= "Press any key to continue.";
prompt ??= Messages.PressAnyKeyToContinue;
Console.WriteLine(prompt);
return Console.ReadKey();
}
Expand Down Expand Up @@ -612,7 +612,7 @@ private static bool Execute(string fileName, string args = "")
proc.StartInfo = psi;
try
{
Console.WriteLine(Calcpad.Cli.Messages.Loading_The_Settings_File);
Console.WriteLine(Messages.Loading_The_Settings_File);
var result = proc.Start();
proc.WaitForExit();
return result;
Expand Down
Loading

0 comments on commit b96a897

Please sign in to comment.