Simplify Your Workflow: Search MiniWebtool.
Add Extension
Home Page > Math > Calculus > Direction Field / Slope Field Plotter

Direction Field / Slope Field Plotter

Plot the slope field of any first-order ODE y' = f(x, y) over a custom x-y region. Click the canvas to spawn new solution curves, watch particles flow along the field, and see equilibrium nullclines — rendered as a pure SVG you can save or share.

Direction Field / Slope Field Plotter
y' =
Use x and y, operators + - * / ^, and functions sin, cos, tan, exp, ln, log, sqrt, abs. Constants pi and e are available.
min
max
min
max
Each initial condition spawns one RK4 solution curve. After plotting, you can also click the canvas to add more.

Embed Direction Field / Slope Field Plotter Widget

About Direction Field / Slope Field Plotter

The Direction Field / Slope Field Plotter visualizes the geometry of any first-order ordinary differential equation y' = f(x, y) without solving it analytically. At every point on a customizable grid it draws a small tangent segment whose slope equals f(x, y), revealing entire families of solution curves at a glance. An interactive SVG canvas lets you click to spawn RK4-integrated solution curves, animate particles flowing along the field, and export the result as a publication-ready image.

What Is a Direction Field?

Given a first-order ODE y' = f(x, y), a direction field (also called a slope field) is a grid of short line segments placed at regularly spaced points (xi, yj). Each segment has slope f(xi, yj), which is the tangent slope of any solution curve passing through that point. Because solutions must stay tangent to the field everywhere they go, the overall picture shows you the qualitative behavior of the ODE — attractors, repellers, equilibrium lines, oscillations — before you ever write down an explicit formula.

y' = dy/dx = f(x, y) → draw segment at (x, y) with slope f(x, y)

The technique was popularized in the early 20th century as part of the qualitative theory of differential equations, and it is now a standard pedagogical tool in every introductory ODE course.

Why This Plotter Is Different

Feature This tool Typical online plotter
Click-to-trace curves Tap anywhere to drop a new RK4 solution starting there Fixed set of curves; must re-submit a form
Flow animation Particles flow along the field in real time Static image only
Slope-magnitude coloring Log-scaled gradient reveals nullclines and stiff regions Single color throughout
Vector export Save-as SVG for infinite-zoom graphics Raster PNG only
Hover readout Shows (x, y) and slope under the cursor No live feedback

How Solution Curves Are Computed

For each initial condition (x₀, y₀) you supply, the tool integrates the ODE using the classical fourth-order Runge-Kutta (RK4) method. RK4 samples the slope four times per step — once at the beginning, twice in the middle, and once at the end — and combines them in a weighted average:

k₁ = f(x, y) k₂ = f(x + h/2, y + h·k₁/2) k₃ = f(x + h/2, y + h·k₂/2) k₄ = f(x + h, y + h·k₃) yn+1 = yn + (h/6)(k₁ + 2k₂ + 2k₃ + k₄)

RK4 has local truncation error O(h5) and global error O(h4), so it converges to the true solution four times faster than Euler's method as the step size shrinks. The plotter integrates both forward and backward from (x₀, y₀), so the curve extends to both sides of the initial point and fills the entire visible region.

Reading the Plot

Equilibrium lines and nullclines

Wherever the segments become horizontal, you are on a nullcline — the curve where f(x, y) = 0. In an autonomous ODE y' = g(y), constant nullclines are equilibrium solutions; the coloring makes them easy to spot as blue horizontal bands.

Stable vs unstable equilibria

At a stable equilibrium, neighbouring solutions curl back toward it: arrows above point down, arrows below point up. At an unstable equilibrium the opposite happens. For y' = y(1 − y), y = 1 is stable and y = 0 is unstable — you can see this instantly in the logistic preset.

Steep regions and stiffness

Red segments mark places where |f(x, y)| is large, so solutions change rapidly there. If your plot is dominated by red, the equation is stiff in that region and any numerical integrator will need a small step size to stay accurate.

Input Formats Accepted

1. Differential equation

Anything that parses as a valid math expression using x and y. Common examples: y - x, x*y, sin(x) - y, exp(-x^2) + y, y*(1-y). The caret ^ is converted to ** automatically.

2. Domain

Four numbers for the x and y ranges. Square domains give the most readable plots; if one axis is much longer, the tangent segments will look distorted even though the slope values are correct.

3. Initial conditions

A semicolon- or newline-separated list of x, y pairs. Each pair becomes one RK4 solution curve. Up to 8 initial conditions are accepted; additional curves can be added interactively by clicking on the plot.

How to Use This Plotter

  1. Enter the right-hand side of y' = f(x, y) in the expression field, or pick one of the six preset examples to see classic behavior.
  2. Set the x and y range. Start with a square region centered near the interesting behavior, then zoom in by resubmitting with a tighter range.
  3. List initial conditions as x, y pairs separated by semicolons. You can also leave this blank and add curves after plotting.
  4. Click Plot Direction Field. The SVG renders instantly with slope segments, color-coded magnitude, and any solution curves you specified.
  5. Interact: click or tap anywhere on the canvas to add more solution curves, hover to read off (x, y, slope), press Animate flow to see particles stream along the field, or Save SVG to export.

Worked Example

Take the classic equation y' = y − x. The nullcline is the line y = x, where the slope is zero. Above this line the slope is positive (arrows point up), and below it the slope is negative (arrows point down), so every solution curve is asymptotically pushed away from y = x in the vertical direction.

y' = y − x → nullcline: y = x general solution: y = x + 1 + C·ex

The plotter confirms this geometry visually: all trajectories except the particular solution y = x + 1 blow up exponentially, and the coloring turns the line y = x into a clear blue streak where slopes vanish.

Common Use Cases

Limitations

The tool handles first-order explicit ODEs only — systems like dy/dx = f(x, y), dz/dx = g(x, y, z) require a phase-portrait tool. Implicit equations F(x, y, y') = 0 must be rewritten in the form y' = f(x, y) before plotting. Near singularities (points where f(x, y) is infinite or undefined), the grid is sparse and RK4 traces stop cleanly rather than extrapolating.

Frequently Asked Questions

What is a direction field (slope field)?

A direction field or slope field is a grid of short line segments placed at regularly spaced points in the x-y plane. At each point (x, y) the segment has slope equal to f(x, y), the right-hand side of a first-order ODE y' = f(x, y). Solution curves of the ODE must be tangent to the segments at every point, which lets you visualize entire families of solutions without solving the equation analytically.

How does the tool draw solution curves?

For every initial condition you provide, the tool integrates the ODE numerically using the classical fourth-order Runge-Kutta (RK4) method with a small step size. RK4 evaluates the slope four times per step and combines them with a weighted average to produce a trajectory that is accurate to O(h^4). The curve is traced both forward and backward from the starting point until it leaves the plot region or the slope becomes infinite.

What functions can I use in the expression?

You can use the arithmetic operators + - * / ^ together with the variables x and y, plus trigonometric functions (sin, cos, tan, asin, acos, atan), hyperbolic functions (sinh, cosh, tanh), exponential and logarithmic functions (exp, ln, log, log10), square root (sqrt), absolute value (abs), and the constants pi and e. Example valid expressions include y - x, x*y, sin(x)*cos(y), and exp(-x^2) + y.

What does the color mean?

When Color by |slope| is selected, each slope segment is colored by the magnitude of the slope at that point using a logarithmic scale. Blue indicates a small slope (nearly horizontal flow), and red indicates a large slope (nearly vertical flow). This reveals features such as equilibrium lines, stiff regions, and attractors at a glance.

What is a nullcline and why does it matter?

A nullcline is the set of points where f(x, y) = 0, so the slope field is horizontal along the nullcline. In an autonomous ODE, nullclines often contain equilibrium solutions; in non-autonomous equations they mark turning points of solutions. The tool highlights these regions with nearly horizontal blue segments when Color by slope is on.

Can I use this tool on mobile?

Yes. The layout adapts to small screens and the SVG plot uses touch events, so you can tap anywhere on the canvas to add a new solution curve. All computations are performed server-side so the tool works identically on phones, tablets, and desktops.

Further Reading

Reference this content, page, or tool as:

"Direction Field / Slope Field Plotter" at https://MiniWebtool.com/direction-field-slope-field-plotter/ from MiniWebtool, https://MiniWebtool.com/

by miniwebtool team. Updated: Apr 22, 2026

You can also try our AI Math Solver GPT to solve your math problems through natural language question and answer.

Related MiniWebtools:

Calculus:

Top & Updated:

Random Name PickerRandom PickerInstagram User ID LookupFPS ConverterImage ResizerLine CounterSort NumbersRelative Standard Deviation CalculatorRemove SpacesRandom Truth or Dare GeneratorBatting Average CalculatorMAC Address GeneratorFacebook User ID LookupERA CalculatorFeet and Inches to Cm ConverterWord to Phone Number ConverterMAC Address LookupSun, Moon & Rising Sign Calculator 🌞🌙✨Slope and Grade CalculatorMP3 LooperSum CalculatorRandom Superpower GeneratorPercent Off CalculatorRandom IMEI Generator📷 OCR / Image to TextAudio SplitterRandom Quote GeneratorInvisible Text GeneratorWord Ladder GeneratorBitwise CalculatorNumber of Digits CalculatorVertical Jump CalculatorRoman Numerals ConverterSHA256 Hash GeneratorRandom Credit Card GeneratorAI Text HumanizerMerge VideosRandom Birthday GeneratorLog Base 10 CalculatorWAR CalculatorHalfway Date Calculator⬛ Aspect Ratio CalculatorMaster Number CalculatorCm to Feet and Inches ConverterSalary Conversion CalculatorPhone Number ExtractorRandom Meal GeneratorRandom Activity GeneratorSaturn Return CalculatorRandom Fake Address GeneratorFile Size ConverterOPS CalculatorNumber to Word ConverterIP Subnet CalculatorText FormatterSquare Root (√) CalculatorOn Base Percentage CalculatorRandom Poker Hand GeneratorRandom Writing Prompt GeneratorYouTube Channel StatisticsRandom Movie PickerSlugging Percentage CalculatorCaffeine Overdose CalculatorMercury Retrograde CalendarDecimal to BCD ConverterCompound Growth CalculatorLove Compatibility CalculatorVideo to Image ExtractorBattery Life CalculatorRandom Loadout GeneratorBCD to Decimal ConverterBinary to Gray Code ConverterStair CalculatorLeap Years List🖱️ Click CounterOctal CalculatorDNS LookupAdd Text to Image🎰 Gacha Pity CalculatorCM to Inches ConverterFirst n Digits of PiRandom Time GeneratorConnect the Dots GeneratorCompare Two Strings📅 Date CalculatorWeight Loss CalculatorSHA512 Hash GeneratorRemove AccentNumber ExtractorBingo Card GeneratorVideo CompressorProportion CalculatorImage SplitterAstrological Element Balance CalculatorImage CompressorPercent Growth Rate CalculatorOutlier CalculatorGray Code to Binary ConverterSmall Text Generator ⁽ᶜᵒᵖʸ ⁿ ᵖᵃˢᵗᵉ⁾Lottery Number GeneratorTime Duration CalculatorPER CalculatorCoin FlipperWhat is my Zodiac Sign?Arc Length CalculatorQuotient and Remainder CalculatorRandom Object GeneratorDiff CheckerDay of the Year Calculator - What Day of the Year Is It Today?Word Scramble GeneratorLongest Day of the YearAcreage CalculatorAdd Prefix and Suffix to TextBreak Line by CharactersFlip VideoList of Prime NumbersRandom Emoji GeneratorBolt Torque CalculatorWHIP CalculatorIP Address to Hex ConverterMultiple Fraction CalculatorURL ExtractorAngel Number CalculatorYouTube Tag ExtractorName Number CalculatorMandelbrot Set ExplorerModulo Calculator🔍 Plagiarism CheckerBcrypt Hash Generator / CheckerCone Flat Pattern (Template) GeneratorVideo SplitterPregnancy CalendarBroken Link CheckerMiter Angle CalculatorTessellation GeneratorDay of Year CalendarMD5 Hash GeneratorEmail ExtractorAI Language DetectorRandom Chord GeneratorSteel Weight CalculatorWhat is my Lucky Number?Social Media Username CheckerAntilog CalculatorLong Division CalculatorLunar Calendar ConverterSun Position CalculatorRandom Chess Opening GeneratorRandom Number PickerBinary to BCD ConverterMolarity CalculatorMartingale Strategy CalculatorRandom Line PickerHeight Percentile CalculatorMultiplication CalculatorIs it a Prime Number?Short Selling Profit CalculatorArctan2 CalculatorRandom Tournament Bracket GeneratorDMS to Decimal Degrees ConverterPercentile CalculatorFirst n Digits of eAI Punctuation AdderCollage MakerMorse Code GeneratorRounding CalculatorBonus CalculatorYouTube Earnings EstimatorRandom Name GeneratorRandom User-Agent GeneratorTaco Bar Calculator🔊 Tone GeneratorRemove Leading Trailing SpacesAdjust Video SpeedHypotenuse CalculatorRandom Group GeneratorHTML CompressorBoiling Point CalculatorRandomize NumbersReverse TextAPI TesterFraction CalculatorAI ParaphraserDue Date CalculatorLife Path Number CalculatorJulia Set GeneratorSquare Numbers ListColor InverterPVIF CalculatorPVIFA CalculatorCrossword Puzzle MakerRandom RPG Character GeneratorBirth Day of the Week CalculatorIncome Tax CalculatorHebrew Calendar ConverterGrade CalculatorSum of Positive Integers CalculatorExponential Decay CalculatorSort Lines AlphabeticallyHex to BCD ConverterBCD to Binary ConverterBCD to Hex ConverterMedian CalculatorStandard Error CalculatorList RandomizerAverage CalculatorReverse VideoRemove Audio from VideoActual Cash Value CalculatorScientific Notation to Decimal ConverterLog Base 2 CalculatorRoot Mean Square CalculatorSHA3-256 Hash GeneratorAI Sentence ExpanderLbs to Kg ConverterHex to Decimal ConverterConvolution CalculatorMAC Address AnalyzerRandom String GeneratorAmortization CalculatorMarkup CalculatorDecimal to Hex ConverterInstagram Font GeneratorSocial Media Image Size GuideTikTok Money CalculatorTwitter/X Character CounterTwitter/X Timestamp ConverterYouTube Watch Time CalculatorTwitch Earnings CalculatorYouTube Shorts Monetization CalculatorFacebook Ad Cost CalculatorSocial Media ROI CalculatorSocial Media Post Time OptimizerCTR CalculatorROAS CalculatorInfluencer ROI CalculatorForce CalculatorAcceleration CalculatorVelocity CalculatorMomentum CalculatorProjectile Motion CalculatorKinetic Energy CalculatorPotential Energy CalculatorWork and Power CalculatorDensity CalculatorPressure CalculatorIdeal Gas Law CalculatorFree Fall CalculatorTorque CalculatorHorsepower CalculatorDilution CalculatorChemical Equation BalancerStoichiometry CalculatorPercent Yield CalculatorEmpirical Formula CalculatorTitration CalculatorMole/Gram/Particle ConverterIrregular Polygon Area CalculatorFrustum CalculatorTorus Calculator3D Distance CalculatorGreat Circle Distance CalculatorCircumscribed Circle (Circumcircle) CalculatorInscribed Circle (Incircle) CalculatorAngle Bisector CalculatorTangent Line to Circle CalculatorHeron's Formula CalculatorCoordinate Geometry Distance CalculatorVolume of Revolution CalculatorSurface of Revolution CalculatorParametric Curve GrapherRiemann Sum CalculatorTrapezoidal Rule CalculatorSimpson's Rule CalculatorImproper Integral CalculatorL'Hôpital's Rule CalculatorMaclaurin Series CalculatorPower Series CalculatorSeries Convergence Test CalculatorInfinite Series Sum CalculatorAverage Rate of Change CalculatorInstantaneous Rate of Change CalculatorRelated Rates SolverOptimization Calculator (Calculus)Gradient Calculator (Multivariable)Divergence CalculatorCurl CalculatorLine Integral CalculatorSurface Integral CalculatorJacobian Matrix CalculatorNewton's Method CalculatorRREF Calculator (Row Echelon Form)Matrix Inverse CalculatorMatrix Multiplication CalculatorDot Product CalculatorCross Product CalculatorVector Magnitude CalculatorUnit Vector CalculatorAngle Between Vectors CalculatorNull Space CalculatorColumn Space CalculatorCramer's Rule CalculatorMatrix Diagonalization CalculatorQR Decomposition CalculatorCholesky Decomposition CalculatorMatrix Power CalculatorCharacteristic Polynomial CalculatorBayes' Theorem CalculatorF-Test / F-Distribution CalculatorHypergeometric Distribution CalculatorNegative Binomial Distribution CalculatorGeometric Distribution CalculatorExponential Distribution CalculatorWeibull Distribution CalculatorBeta Distribution CalculatorSpearman Rank Correlation CalculatorFisher's Exact Test CalculatorContingency Table CalculatorOdds Ratio CalculatorROT13 Encoder/DecoderAtbash Cipher ToolVigenère Cipher ToolPronunciation IPA ConverterHemingway-Style Readability EditorSentence Length Variance AnalyzerWord Frequency AnalyzerBusiness Days CalculatorAdd Business Days to DateDate Pattern GeneratorHow Long Until CalculatorHow Long Ago CalculatorBirthday Across Cultures CalculatorHijri Calendar ConverterInsulin Sensitivity Factor CalculatorCarb-to-Insulin Ratio CalculatorLean Body Mass to Strength CalculatorOne-Mile Walk Test (Rockport) CalculatorCooper 12-Minute Run CalculatorFFMI CalculatorAPGAR Score CalculatorGlasgow Coma Scale CalculatorWells Score Calculator (DVT/PE)Tennis Score TrackerSoccer xG (Expected Goals) CalculatorCricket Run Rate CalculatorRugby Points CalculatorBoxing Punch Power CalculatorRace Time PredictorSwimming SWOLF CalculatorYoga Pose Hold TimerFishing Knot Strength CalculatorBike Gear Ratio CalculatorClimbing Grade ConverterWine Pairing SuggesterStandard Drink CalculatorCaffeine Half-Life TrackerSpice Substitution FinderDietary Restriction Recipe FilterMarinade Time CalculatorFermentation Time CalculatorSmoking Wood Pairing GuideFreelance Project Pricing CalculatorSaaS Pricing CalculatorSubscription Cost TrackerSide Hustle ROI CalculatorRemote Work Savings CalculatorCoffee Habit Cost CalculatorGym vs Home Workout Cost CalculatorLunch Cost CalculatorWealth Growth Visualizer1031 Exchange CalculatorRental Yield CalculatorCash-on-Cash Return CalculatorBRRRR Method CalculatorSection 8 Rent CalculatorRoommate Rent SplitterAirbnb Pricing OptimizerStatute of Limitations CalculatorSentence Reduction CalculatorSales Tax Nexus CheckerPatent Filing Fee CalculatorTrademark Class FinderWill Asset Distribution CalculatorWorkers' Compensation CalculatorStopping Distance CalculatorTrip Cost SplitterVehicle Weight Distribution CalculatorTrailer Tongue Weight CalculatorTire Tread Wear CalculatorEngine Compression Ratio CalculatorHeadlight Beam Distance CalculatorCat Litter Box CalculatorAquarium Heater Wattage CalculatorBird Cage Size CalculatorReptile Habitat UVB CalculatorPet Travel Crate Size FinderHorse Hay CalculatorCrochet Hook Size ConverterKnitting Needle Size ConverterKnitting Pattern CalculatorCross-Stitch Floss CalculatorQuilt Binding CalculatorOrigami Paper Size CalculatorPottery Clay Shrinkage CalculatorBeading Pattern CalculatorResin Casting Volume CalculatorEmbroidery Thread Length CalculatorHiking Pace Calculator (Naismith's Rule)Backpacking Food Weight CalculatorTent Footprint Size CalculatorSleeping Bag Temperature Rating GuideKnot Tying Reference ToolStar Visibility CalculatorTide Time CalculatorReynolds Number CalculatorBernoulli Equation CalculatorHeat Transfer CalculatorThermal Expansion CalculatorSpecific Heat Capacity CalculatorGear Ratio Calculator (Mechanical)Pulley System CalculatorHydraulic Cylinder Force CalculatorBelt Length CalculatorCloset Capsule CalculatorStorage Unit Size CalculatorMoving Box Quantity CalculatorGift Card Tip CalculatorGas vs Electric Cost ComparisonPrint Cost CalculatorHair Dye Mixing CalculatorLaundry Detergent Dosage CalculatorDishwasher Load OptimizerTile Grout CalculatorPaint Color Mixing CalculatorFlashcard Spaced Repetition SchedulerLearning Curve CalculatorCornell Notes GeneratorVocabulary Quiz GeneratorLanguage Learning Hours to Fluency CalculatorCollege Cost CalculatorScholarship ROI CalculatorAI Recipe Generator (From Ingredients)AI Gift Idea GeneratorAI Meal Plan GeneratorAI Workout Plan GeneratorAI Reading List Generator