Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More "adaptive" plot function? #8

Open
axkr opened this issue Sep 20, 2019 · 2 comments
Open

More "adaptive" plot function? #8

axkr opened this issue Sep 20, 2019 · 2 comments

Comments

@axkr
Copy link

axkr commented Sep 20, 2019

Can we get a more "adaptive" plot function?

See for example these discussions:

Especially this function plot example will benefit from such an "adaptive" approach:

<html>
<head>
<meta charset="utf-8">
<title>MathCell</title>
<link rel="stylesheet" type="text/css" href="style.css">
<style></style>
</head>

<body>
<script src="https://cdn.jsdelivr.net/gh/paulmasson/[email protected]/build/math.js"></script>

<script src="https://cdn.jsdelivr.net/gh/paulmasson/[email protected]/build/mathcell.js"></script>
<script src="https://cdn.jsdelivr.net/gh/mathjax/[email protected]/MathJax.js?config=TeX-AMS_HTML"></script>
<div class="mathcell" style="width: 100%; height: 100%; padding: .25in .5in .5in .5in;">
<script>

var parent = document.scripts[ document.scripts.length - 1 ].parentNode;

var id = generateId();
parent.id = id;

MathCell( id, [  ] );

parent.update = function( id ) {


function z1(x) { return tan(x); }

var p1 = plot( z1, [0, (6.283185307179586)], { } );
var data = [ p1 ];
var config = { type: 'svg' , yMin: -200, yMax: 200 };
evaluate( id, data, config );

}

parent.update( id );

</script>
</div>

</body>
</html>

@axkr
Copy link
Author

axkr commented Sep 28, 2019

Another interesting example:

<html>
<head>
<meta charset="utf-8">
<title>MathCell</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>

<body>
<script src="https://cdn.jsdelivr.net/gh/paulmasson/[email protected]/build/math.js"></script>

<script src="https://cdn.jsdelivr.net/gh/paulmasson/[email protected]/build/mathcell.js"></script>
<script src="https://cdn.jsdelivr.net/gh/mathjax/[email protected]/MathJax.js?config=TeX-AMS_HTML"></script>
<div class="mathcell" style="width: 100%; height: 100%; padding: .25in .5in .5in .5in;">
<script>

var parent = document.scripts[ document.scripts.length - 1 ].parentNode;

var id = generateId();
parent.id = id;

MathCell( id, [  ] );

parent.update = function( id ) {


function z1(x) { return Math.round(x); }

var p1 = plot( z1, [-5, 5], { } );
var data = [ p1 ];
var config = { type: 'svg'  };
evaluate( id, data, config );

}

parent.update( id );

</script>
</div>

</body>
</html>

@paulmasson
Copy link
Owner

More input from @axkr:

Interval arithmetic to solve the problems for Tan, Cot: https://mauriciopoppe.github.io/function-plot/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants