Comments (3)
A few related problems here which are due to the fact that we have a pretty dumb sampling routine at the moment. Ideally we want an adaptive sampler.
For an xy plot, Mathematica does this:
- subdivide domain equally into (PlotPoints - 1) intervals
- look at each 3 successive points ABC
- If angle ABC > MaxBend, also plot midpoints of AB and BC
- Terminate the subdivision when interval length is less than 1/(PlotPoints * PlotDivision)
Probably best to use differences between Math.atan2 over AB and BC to find angle ABC. atan2 values can be cached for use in the next triple.
atan2 has a branch at dy/dx == 0, so near horizontal line segments must test for near equalty or a diff of near ±2π.
An atan2 diff near ±π indicates a singular point. A null data value should be inserted at the singularity so d3 can chop the line and so avoid drawing a vertical stroke.
Refs:
- Mathematica book Plot, PlotPoints, PlotDivision, MaxBend
- http://demonstrations.wolfram.com/AdaptivePlotting/
- http://scicomp.stackexchange.com/questions/2377/algorithms-for-adaptive-function-plotting
from apps1.
Need a similar algorithm for a parametric plot.
from apps1.
NB, this algorithm could generate lists of interesting plot features - like assymptotes, and turning values. These could
be indicated visually so student is prompted to label them.
from apps1.
Related Issues (20)
- Laundry list of little mathmo question problems HOT 11
- mathmo routing not working HOT 3
- Create a new 'Diamond Collector' fluency app.
- lib for embedding
- Once an exercise has been created in the “shared” tab, it can’t be used in a user’s exercise tab
- New questions needed HOT 3
- Graph plotter
- Enigma simulator needed
- A Proof Sorter
- Refactor reusable code
- mathmo plots fail to work in unmasked mode but are ok in masked mode HOT 1
- update to angular.js 1.0.7 HOT 1
- `grunt test` doesn't run the old frogs and d3 directive tests HOT 2
- Update LiveScript compiler HOT 1
- Automate library updates - using yeoman/bower generated apps
- sharing implementation broken HOT 1
- Angular-ui/bootstrap v0.5.0 does not optimize
- Move individual Apps each to their own repository
- Upgrade karma configuration files to latest format
- Update mathmo to use qalib HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from apps1.