-
Graphing 1.2.0 Stable
released this
2024-03-21 12:37:35 -04:00 | 24 commits to main since this releaseGraphing 1.2.0
This is the third important release of the graphing calculator. This update is
fairly all over the place, but here are the important parts. First of all, the
system for integrating equations has been drastically improved. Originally, the
system was laggy for intensive equations and especially for second or third
order integrals, and the line itself would appear quite choppy if you zoom in
far enough. This was because the original system would compute the integral at
a point by just accumulating the area from 0 to that point. So if you asked for
the integral of an equation at 2.1 and then again at 2.2, the work for
calculating 2.1 would be done twice.This has since been improved. There is a new graphable specifically for the
displaying integrals called theIntegralEquation. This graphable is a
modified version of theEquationgraphable with some notable optimizations.
Now, rather than doing duplicate work when calculating points one-after-another
is done by increasing an internal stepper rather than recomputing from scratch.
The result makes integrating many points in order (which is done for hundreds
of points per frame) is now remarkably faster. High order integrals are now
almost as fast as their parent equation, and in this regard only, I think I
have a win against Desmos. Their integration can prove to be slower than mine.
Another benefit of this new method is that the change in the accumulation is
dependent on zoom, meaning the graph does not appear jagged or choppy at all
when you zoom in. It has a side of effect of making the graph more laggy when
you zoon in a whole bunch, but for most purposes, this system is much faster.I've also made the line thickness of the graph dependent on the DPI of the
monitor used. I honestly would've thought that Windows Forms would handle that
part for me, but it doesn't. So in theGraphFormthere is now a new property
calledDpiFloatwhich represents the DPI of the screen. All the graph parts
now have their line thickness scaled by a factor ofDpiFloat / 192, since my
development display has a DPI of 192, I'm using that for reference. It's a bit
redundant though. I think in a future update (marked on the project board),
I'll replace theDpiFloat / 192system with a simplerDpiFactorproperty.And I've made some light progress on a more modular approach to applying
operators to graphs. Currently you can only integrate and derive in the UI,
but I've replaced the simple check for anEquationtype with a more modular
interface check. To make your graphable appear in the derivation menu, make
your graphable implement theIDerivableinterface.That's about it for now. If you want the specific changelog, it's below:
- Added
.github/to the Gitignore. Not sure why it's appeared but I'm adding it just in case. - Added the following feature interfaces:
IDerivable- Used to derive graphs.IIntegrable- Used to integrate graphs.
- Disabled implicit usings in the project properties. It's mostly for debugging help.
- Added some more NuGet tags.
- Added the
DpiFloatproperty to theGraphFormfor use with scaling UI elements.- Also added the
DpiFloatproperty to thePieChartcontrol for the same purpose.
- Also added the
- The
PieChartcontrol no longer draws an extraneous edge when there's only one item on the chart. - Increased the maximum zoom level from
0.01to0.00001. - The form now draws units on the main axes which scale with zoom level.
- There is now a
UnitsTextColorconstant for the text color.
- There is now a
- Created a graph selection detection system for specific graphables.
- Stores generated pens to prevent duplicate work.
- Prevents scrolling the screen when selecting a graph.
- The color picker form now won't appear partially or entirely off the edge of the screen.
- Replaced generating UI options for equations with generating UI options for individual interfaces.
- Currently
IDerivableandIIntegrable.
- Currently
- Replaced the old
EquationComputeDerivative_Clickmethod with a simplerGraph(derivable.Derive())method. - Replaced the old
EquationComputeIntegral_Clickmethod with a simplerGraph(integrable.Integrate())method. - The cache form now won't appear partially or entirely off the edge of the screen.
- The cache form now is always shown on top of the main form.
- Added the ability to preload graphables at a higher depth.
- Made the buttons for the cache viewer variables and made them scale with DPI.
- Got rid of the very slight transparency in preset graph colors.
- Made all optional methods
virtualinstead ofabstract. - Added the following optional methods to the base
Graphabletype:void Preload(Float2, Float2, double)bool ShouldSelectGraphable(in GraphForm, Float2, double)Float2 GetSelectedPoint(in GraphForm, Float2)
- Removed the unused
EraseCachemethod inColumnTable - Made the
Equationgraphable implementIDerivableandIIntegrable. - The equation sampling rate now scales with DPI.
- Added the ability to select a point along an equation.
- The equation now draws the extra little bit that was previously missing on the right side of the screen.
- Added the
IntegralEquation, which can integrate equations much faster than the standard method. - Added the ability to select a point along a
SlopeField. - Made the
Positionproperty of aTangentLinemore dynamic. - Added the ability to cache previous heights and slopes in a
TangentLineautomatically. - In
TangentLine, made theMakeSlopeLineuse already-existing properties rather than arguments. - Added a caching system to
DerivativeAtPointinTangentLine. - Added implementations to
EraseCacheandGetCacheBytesinTangentLine. - Added the ability to select a point along a tangent line.
- Replaced the
Rendermethod passing aBrushwith one passing aPento prevent duplicate work. - Modified the README some.
- Changed the demonstration default.
Downloads
- Added