Public Rest API for my Math Evaluation Library
All math is being evaluated using the Math Evaluation Library
http://math-rest-api-jhk.appspot.com/expression
Request URL
http://math-rest-api-jhk.appspot.com/expression?input=<Math Input>
JQuery Ajax Request Code
$.ajax({
url:"http://math-rest-api-jhk.appspot.com/expression",
type:"POST",
contentType: "application/json; charset=utf-8"
async: false,
cache: false,
processData:false,
data: JSON.stringify({"input":<Math Input>}),
success: function(data){ ... },
error: function(request, status, error){ ... }
});
JSON Response
{
"input":"sin(π/6)",
"output":{
"valid":true,
"numbers":[
3.141592653589793,
6.0
],
"integer":false,
"numberExpression":false,
"postfix":"π 6 / sin",
"tex":"\\sin\\left(\\dfrac{\\pi}{6}\\right)",
"infix":"sin(π/6)",
"rational":false,
"value":0.5
}
}
http://math-rest-api-jhk.appspot.com/expression/evaluate
Request URL
http://math-rest-api-jhk.appspot.com/expression/evaluate?input=<Math Input>
JQuery Ajax Request Code
$.ajax({
url:"http://math-rest-api-jhk.appspot.com/expression/evaluate",
type:"POST",
contentType: "application/json; charset=utf-8"
async: false,
cache: false,
processData:false,
data: JSON.stringify({"input":<Math Input>}),
success: function(data){ ... },
error: function(request, status, error){ ... }
});
JSON Response
{
"input":"sin(π/6)",
"output":{
"valid":true,
"numbers":[0.5],
"integer":false,
"numberExpression":true,
"postfix":"0.5",
"tex":"0.5",
"infix":"0.5",
"rational":false,
"value":0.5
}
}
http://math-rest-api-jhk.appspot.com/expression/simplify
Request URL
http://math-rest-api-jhk.appspot.com/expression/simplify?input=<Math Input>
JQuery Ajax Request Code
$.ajax({
url:"http://math-rest-api-jhk.appspot.com/expression/simplify",
type:"POST",
contentType: "application/json; charset=utf-8"
async: false,
cache: false,
processData:false,
data: JSON.stringify({"input":<Math Input>}),
success: function(data){ ... },
error: function(request, status, error){ ... }
});
JSON Response
{
"input":"sinx/cosx",
"output":{
"valid":true,
"numbers":[],
"integer":false,
"numberExpression":false,
"postfix":"x tan",
"tex":"\\tan\\left(x\\right)",
"infix":"tan(x)",
"rational":false,
"value":"NaN"
}
}
http://math-rest-api-jhk.appspot.com/expression/fraction
Request URL
http://math-rest-api-jhk.appspot.com/expression/fraction?input=<Math Input>
JQuery Ajax Request Code
$.ajax({
url:"http://math-rest-api-jhk.appspot.com/expression/fraction",
type:"POST",
contentType: "application/json; charset=utf-8"
async: false,
cache: false,
processData:false,
data: JSON.stringify({"input":<Math Input>}),
success: function(data){ ... },
error: function(request, status, error){ ... }
});
JSON Response
{
"input":"sin(π/6)",
"output":{
"valid":true,
"rational":true,
"numbers":[
1.0,
2.0
],
"integer":false,
"numberExpression":false,
"postfix":"1 2 /",
"tex":"\\dfrac{1}{2}",
"infix":"1/2",
"value":0.5
}
}
http://math-rest-api-jhk.appspot.com/expression/valueOf
Request URL
http://math-rest-api-jhk.appspot.com/expression/valueOf?input=<Math Input>
JQuery Ajax Request Code
$.ajax({
url:"http://math-rest-api-jhk.appspot.com/expression/valueOf",
type:"POST",
contentType: "application/json; charset=utf-8"
async: false,
cache: false,
processData:false,
data: JSON.stringify({"input":<Math Input>}),
success: function(data){ ... },
error: function(request, status, error){ ... }
});
JSON Response
{
"input":"sin(π/6)",
"output":{
"value":0.5
}
}