rurihabachi
Japanese Home



Home

Math Tools



>Web API<

How to use

Calculation
Function(x)
F(x)-x graph
Differentiation



Feedback









Function(x) - Web API

This API calculates a provided function(x) with a given range of x, and returns calculated numerical values.

  » Check also the feature of this API: go to Functional Calculator - f(x) page (math tool).

To use this API, access to the URLs listed below.
Each Web API returns XML / JSON (JSONP) / CSV data.

XML http://www.rurihabachi.com/web/webapi/functionx/xml
JSON/JSONP http://www.rurihabachi.com/web/webapi/functionx/json
CSV http://www.rurihabachi.com/web/webapi/functionx/csv

  » See also How to use Web API page.


Parameters:  (*required)
fx * string a function(x) (e.g. x^2+x+2)
- valid characters (x is a variable, a, b, and c are constants): 1234567890+-*/()^,pi,e,sqrt,log,abs,sin,cos,tan,a,b,c,x
xfrom string a start value of x (e.g. -10)
xto string an end value of x (e.g. 10)
xspan string a span of x values (e.g. 1)
a string a value of a
b string a value of b
c string a value of c
callback string a callback function name (e.g. setResult)
- valid only JSONP

Return values:
function string a recognized function of x (might have a different form from the submited function).
e.g. x^2+x+2, ax+b
avalue string a value of a (empty if value of a is not set)
bvalue string a value of b (empty if value of b is not set)
cvalue string a value of c (empty if value of c is not set)
status integer 0:OK(calculated), 1 - 999:error
message string an error message etc.
count integer the number of the result value sets
valuelist/value - result value sets (empty if status is not 0)
xvalue string a value of x
e.g. 3.0, 1.1*10^12
functionvalue string a calculated value
e.g. 14.0, 2.893726238034*10^(-13)

      *      *      *

Return data samples:

  XML
<?xml version="1.0" encoding="UTF-8"?>

<result function="functionx">
  <function>ax+b</function>
  <avalue>2.0</avalue>
  <bvalue>3.0</bvalue>
  <cvalue></cvalue>
  <status>0</status>
  <message>OK</message>
  <count>5</count>
  <valuelist>
    <value>
      <xvalue>-10.0</xvalue>
      <functionvalue>-17.0</functionvalue>
    </value>
    <value>
      <xvalue>-5.0</xvalue>
      <functionvalue>-7.0</functionvalue>
    </value>
    <value>
      <xvalue>0.0</xvalue>
      <functionvalue>3.0</functionvalue>
    </value>
    <value>
      <xvalue>5.0</xvalue>
      <functionvalue>13.0</functionvalue>
    </value>
    <value>
      <xvalue>10.0</xvalue>
      <functionvalue>23.0</functionvalue>
    </value>
  </valuelist>
</result>

  JSON(JSONP)
{"function":"ax+b","avalue":"2.0","bvalue":"3.0","cvalue":"","status":0,"message":"OK"
,"count":5,"valuelist":[{"xvalue":"-10.0","functionvalue":"-17.0"}
,{"xvalue":"-5.0","functionvalue":"-7.0"},{"xvalue":"0.0","functionvalue":"3.0"}
,{"xvalue":"5.0","functionvalue":"13.0"},{"xvalue":"10.0","functionvalue":"23.0"}]}

  CSV
"ax+b","2.0","3.0","",0,"OK",5
"-10.0","-17.0"
"-5.0","-7.0"
"0.0","3.0"
"5.0","13.0"
"10.0","23.0"


Copyright (C) 2011-2020 rurihabachi. All rights reserved.