# Trouble using Apache Common Maths module

**URL:** <https://forum.inductiveautomation.com/t/trouble-using-apache-common-maths-module/33279>\
**Category:** Ignition\
**Created:** [March 20, 2020, 3:42pm UTC](https://forum.inductiveautomation.com/t/trouble-using-apache-common-maths-module/33279 "2020-03-20T15:42:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dbommarito](https://avatars.discourse-cdn.com/v4/letter/d/ed8c4c/32.png) [@dbommarito](https://forum.inductiveautomation.com/u/dbommarito)\
**Post date:** [March 20, 2020, 3:42pm UTC](https://forum.inductiveautomation.com/t/trouble-using-apache-common-maths-module/33279/1 "2020-03-20T15:42:55Z")

</div>

I am using the Ignition Viewer app trying to get the Apache Common Maths Spline Interpolator to work within the scripting editor. This will eventually be used with a corresponding data set. This is the code we have to try it for simplicity purposes (to output the function result to a message box), but not sure what we are missing, given that the interpolate function asks for 2 args, not 3.

 ![Code](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/b0e61e5dda73ac09bfb4ce5e6874d73527e40285.png)

 ![Capture](https://us1.discourse-cdn.com/inductiveautomation/original/2X/9/9e87a859cf37bc9e19fac6345538731ae1ea4251.png)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [March 20, 2020, 3:55pm UTC](https://forum.inductiveautomation.com/t/trouble-using-apache-common-maths-module/33279/2 "2020-03-20T15:55:06Z")

</div>

I think the issue is that you’re trying to call `interpolate` as if it were a statically defined function on `SplineInterpolator`, and it’s not - you need to create an instance of it and then call the method on that instance.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 20, 2020, 4:20pm UTC](https://forum.inductiveautomation.com/t/trouble-using-apache-common-maths-module/33279/3 "2020-03-20T16:20:45Z")

</div>

Yeah, it looks like `psf = SplineInterpolator().interpolate(x, y)` should work fine. The ‘missing third argument’ is probably `self`, because of the way Python/Jython does instance methods on classes.
