ASCIIMath SVG Graphing

118 views
Skip to first unread message

heather williams

unread,
Sep 1, 2011, 9:57:14 AM9/1/11
to ASCIIMath
I have recently started using the ASCIIMath SVG Graphing tool and I
was trying to make trigonometric graphs. The tool only seems to
support the use of radians for this, and while this is fine for most
of the usage, there are a few cases that require graphs in degrees. I
tried multiplying the variable by 6.2/360 which produced the graph
that I wanted. However, I have to be able to teach teachers how to use
this tool and teaching them a hack is not the best way to go, does
anyone know if this is possible to do quickly and easily? Is there a
line of code that I can add in somewhere to make it do this?

David Lippman

unread,
Sep 21, 2011, 7:07:17 PM9/21/11
to ASCIIMath
You could define some new functions which do sin/cos/tan on degree
inputs:

var degsin = function(x) { return Math.sin(x*Math.PI/180); }
var degcos = function(x) { return Math.cos(x*Math.PI/180); }
var degtan = function(x) { return Math.tan(x*Math.PI/180); }
Reply all
Reply to author
Forward
0 new messages