• That-One-Nerd released this 2024-03-21 12:37:35 -04:00 | 24 commits to main since this release

    Graphing 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 the IntegralEquation. This graphable is a
    modified version of the Equation graphable 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 the GraphForm there is now a new property
    called DpiFloat which represents the DPI of the screen. All the graph parts
    now have their line thickness scaled by a factor of DpiFloat / 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 the DpiFloat / 192 system with a simpler DpiFactor property.

    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 an Equation type with a more modular
    interface check. To make your graphable appear in the derivation menu, make
    your graphable implement the IDerivable interface.

    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 DpiFloat property to the GraphForm for use with scaling UI elements.
      • Also added the DpiFloat property to the PieChart control for the same purpose.
    • The PieChart control no longer draws an extraneous edge when there's only one item on the chart.
    • Increased the maximum zoom level from 0.01 to 0.00001.
    • The form now draws units on the main axes which scale with zoom level.
      • There is now a UnitsTextColor constant for the text color.
    • 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 IDerivable and IIntegrable.
    • Replaced the old EquationComputeDerivative_Click method with a simpler Graph(derivable.Derive()) method.
    • Replaced the old EquationComputeIntegral_Click method with a simpler Graph(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 virtual instead of abstract.
    • Added the following optional methods to the base Graphable type:
      • void Preload(Float2, Float2, double)
      • bool ShouldSelectGraphable(in GraphForm, Float2, double)
      • Float2 GetSelectedPoint(in GraphForm, Float2)
    • Removed the unused EraseCache method in ColumnTable
    • Made the Equation graphable implement IDerivable and IIntegrable.
    • 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 Position property of a TangentLine more dynamic.
    • Added the ability to cache previous heights and slopes in a TangentLine automatically.
    • In TangentLine, made the MakeSlopeLine use already-existing properties rather than arguments.
    • Added a caching system to DerivativeAtPoint in TangentLine.
    • Added implementations to EraseCache and GetCacheBytes in TangentLine.
    • Added the ability to select a point along a tangent line.
    • Replaced the Render method passing a Brush with one passing a Pen to prevent duplicate work.
    • Modified the README some.
    • Changed the demonstration default.
    Downloads