# lockehamann/GeometryCalc

### Subversion checkout URL

You can clone with HTTPS or Subversion.

Init

commit 15784f55740fdc3d8e636b671b691ce2a38129d4 1 parent 3ee6b6a
authored
BIN  Help.chm
Binary file not shown
BIN  Kernel.dcu
Binary file not shown
85 Kernel.pas
 @@ -0,0 +1,85 @@ +unit kernel; + +interface +uses + SysUtils; + +type + ECantSqrtKernel=class(EMathError); + +function GCD(const a ,b :Int64) : Int64; +function SpeSqrt(const in1 :Int64): Int64; +function LCM(const a ,b :Int64) : Int64; + +implementation + +function GCD(const a,b:Int64):Int64; +//GreatestCommonDivisor 最大公约数 +var + aa,bb,cc:Int64; +begin + aa:=Abs(a); + bb:=Abs(b); + if (aa < bb) then begin + cc:=aa; + aa:=bb; + bb:=cc; + end; + if bb=0 then begin + if aa=0 then + Result:=1 + else + Result:=aa; + exit; + end; + while aa mod bb<>0 do begin + cc:=bb; + bb:=aa mod bb; + aa:=cc; + end; + Result:=bb; +end; + +function LCM(const a,b:Int64):Int64; +//LeaseCommonMultiple 最小公倍数 +begin + Result:=(a div GCD(a,b))*b; +end; + +function SpeSqrt(const in1 :Int64): Int64; +//SpeciallySqrt 特殊开方 +var + i,n:Int64; + temp1 :Smallint; + i2 :Integer; +begin + if in1<0 then + raise ECantSqrtKernel.Create('被开方数不能为负'+#13#10+'错误发生在内核部分'); + if in1<2 then begin + Result:=1; + exit; + end; + n:=in1; + temp1:=0; + While n and 3=0 do begin //n mod 4 =0 + n:=n shr 2; //[/4] + Inc(temp1); + end; + Result:=1 shl temp1; //[2^temp1] + While n mod 9=0 do begin + n:=n div 9; + Result:=(Result shl 1)+Result; + end; + i:=5; + i2:=Trunc(Sqrt(in1*1.0))+1; + temp1:=2; + While i2>=i do + if n mod (i*i)=0 then begin + n:=n div (i*i); + Result:=Result*i; + end else begin + Inc(i,temp1); + temp1:=temp1 xor 6;//temp1:=6-temp1; + end; +end; +end.
BIN  MathFunction.dcu
Binary file not shown
1,121 MathFunction.pas
173 Project1.bdsproj
 @@ -0,0 +1,173 @@ +﻿ + + + + + + + + + + + Project1.dpr + + + 7.0 + + + 8 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 1 + 1 + 1 + True + True + WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; + + False + + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + True + False + False + False + True + True + True + + + 0 + 0 + 1 + False + False + False + 16384 + 1048576 + 4194304 + + + + + + + + + vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP + + + False + + + + + + False + + + + + + False + + + True + True + 5 + 9 + 5 + 1 + False + False + False + False + False + 2052 + 936 + + + + + 5.9.5.1 + + + + + + 1.0.0.0 + + (Untitled) + Borland VCL IBX Components for Win32 + Indy 10 Core Design Time + Indy 10 Protocols Design Time + Borland SimpleDataset Component (DBX) + + +
90 Project1.bdsproj.local
38 Project1.cfg
 @@ -0,0 +1,38 @@ +-\$A8 +-\$B- +-\$C+ +-\$D+ +-\$E- +-\$F- +-\$G+ +-\$H+ +-\$I+ +-\$J- +-\$K- +-\$L+ +-\$M- +-\$N+ +-\$O+ +-\$P+ +-\$Q- +-\$R- +-\$S- +-\$T- +-\$U- +-\$V+ +-\$W- +-\$X+ +-\$YD +-\$Z1 +-cg +-AWinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +-H+ +-W+ +-M +-\$M16384,1048576 +-K\$00400000 +-LE"E:\ÎŇľÄÎÄľľ\Borland Studio Projects\Bpl" +-LN"E:\ÎŇľÄÎÄľľ\Borland Studio Projects\Bpl" +-w-UNSAFE_TYPE +-w-UNSAFE_CODE +-w-UNSAFE_CAST
138 Project1.dof
 @@ -0,0 +1,138 @@ +[FileVersion] +Version=7.0 +[Compiler] +A=8 +B=0 +C=1 +D=1 +E=0 +F=0 +G=1 +H=1 +I=1 +J=0 +K=0 +L=1 +M=0 +N=1 +O=1 +P=1 +Q=0 +R=0 +S=0 +T=0 +U=0 +V=1 +W=0 +X=1 +Y=1 +Z=1 +ShowHints=1 +ShowWarnings=1 +UnitAliases=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE; +NamespacePrefix= +SymbolDeprecated=1 +SymbolLibrary=1 +SymbolPlatform=1 +UnitLibrary=1 +UnitPlatform=1 +UnitDeprecated=1 +HResultCompat=1 +HidingMember=1 +HiddenVirtual=1 +Garbage=1 +BoundsError=1 +ZeroNilCompat=1 +StringConstTruncated=1 +ForLoopVarVarPar=1 +TypedConstVarPar=1 +AsgToTypedConst=1 +CaseLabelRange=1 +ForVariable=1 +ConstructingAbstract=1 +ComparisonFalse=1 +ComparisonTrue=1 +ComparingSignedUnsigned=1 +CombiningSignedUnsigned=1 +UnsupportedConstruct=1 +FileOpen=1 +FileOpenUnitSrc=1 +BadGlobalSymbol=1 +DuplicateConstructorDestructor=1 +InvalidDirective=1 +PackageNoLink=1 +PackageThreadVar=1 +ImplicitImport=1 +HPPEMITIgnored=1 +NoRetVal=1 +UseBeforeDef=1 +ForLoopVarUndef=1 +UnitNameMismatch=1 +NoCFGFileFound=1 +MessageDirective=1 +ImplicitVariants=1 +UnicodeToLocale=1 +LocaleToUnicode=1 +ImagebaseMultiple=1 +SuspiciousTypecast=1 +PrivatePropAccessor=1 +UnsafeType=0 +UnsafeCode=0 +UnsafeCast=0 +[Linker] +MapFile=0 +OutputObjs=0 +ConsoleApp=1 +DebugInfo=0 +RemoteSymbols=0 +MinStackSize=16384 +MaxStackSize=1048576 +ImageBase=4194304 +ExeDescription= +[Directories] +OutputDir= +UnitOutputDir= +PackageDLLOutputDir= +PackageDCPOutputDir= +SearchPath= +Packages=vcl;rtl;vclx;indy;inet;xmlrtl;vclie;inetdbbde;inetdbxpress;dbrtl;dsnap;dsnapcon;vcldb;soaprtl;VclSmp;dbexpress;dbxcds;inetdb;bdertl;vcldbx;webdsnap;websnap;adortl;ibxpress;teeui;teedb;tee;dss;visualclx;visualdbclx;vclactnband;vclshlctrls;IntrawebDB_50_70;Intraweb_50_70;Rave50CLX;Rave50VCL;dclOfficeXP +Conditionals= +DebugSourceDirs= +UsePackages=0 +[Parameters] +RunParams= +HostApplication= +Launcher= +UseLauncher=0 +DebugCWD= +[Language] +ActiveLang= +ProjectLang= +RootDir= +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=1 +MajorVer=5 +MinorVer=8 +Release=5 +Build=1 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=2052 +CodePage=936 +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=5.8.5.1 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +[HistoryLists\hlUnitAliases] +Count=1 +Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
32 Project1.dpr
 @@ -0,0 +1,32 @@ +program Project1; + +uses + Forms, + Kernel in 'Kernel.pas', + MathFunction in 'MathFunction.pas', + UCoordinates in 'UCoordinates.pas', + UEquation in 'UEquation.pas', + UFraction in 'UFraction.pas', + UFrameInput in 'UFrameInput.pas' {FrameInput: TFrame}, + UGetInfo in 'UGetInfo.pas', + UMain in 'UMain.pas' {Form1}, + URadical in 'URadical.pas', + UTempF in 'UTempF.pas' {TempF}, + UtoMathematica in 'UtoMathematica.pas' {ToMathematica}, + UBaseFrame in 'UBaseFrame.pas' {BaseFrame: TFrame}, + UCalcClasses in 'UCalcClasses.pas', + UAngle in 'UAngle.pas', + UHAbout in 'UHAbout.pas' {HAbout}; + +{\$R *.res} +{\$R StringLines.res} + +begin + Application.Initialize; + Application.Title := '平面解析几何计算器'; + Application.CreateForm(TForm1, Form1); + Application.CreateForm(TToMathematica, ToMathematica); + Application.CreateForm(TTempF, TempF); + Application.CreateForm(THAbout, HAbout); + Application.Run; +end.
490 Project1.dsk
BIN  Project1.exe
Binary file not shown
BIN  Project1.res
Binary file not shown
 @@ -1,4 +1,12 @@ GeometryCalc ============ -古董项目，基于符号计算内核的高中解析几何计算程序 +初中时期做得古董项目，使用Delphi编写，基于符号计算内核的高中解析几何计算程序， +维护工作一直到高中。 + +特点： + * 准符号计算内核，对分数、含有“单层”根号的无理数的准确表示，支持相关计算、化简。 + * 支持初中常见的各种解析几何问题。（二维解析几何，其实高中的也就是推广到三维而已……） + * （当时认为的）人性化UI界面，其实做得还是很复杂的，请在输入框里按右键。 + +我会说我就是在这个项目里学的指针么……（一个小屁孩成天调指针BUG伤不起……）
BIN  StringLines.RES
Binary file not shown
BIN  UAngle.dcu
Binary file not shown
95 UAngle.pas