My first extension - quadratic equation

I created my first simple extension (for testing). :champagne:

I have seen this extension: [Extension] Math Formulas [V3]


Yes, this returns x1, which of course can also be negative. But what about x2, grafik ?
grafik

grafik (pq-Formula) and grafik

(not a big deal, I know, but for the first time)

de.BodyMindPower.quadraticEquation.aix (5.6 KB)

UPDATE v2: de.BodyMindPower.quadraticEquation_v2.aix (5.7 KB)

I have simplified the extension following @Vishwas advice:

22 Likes

Good job! Did you use a tutorial to learn the process of developing AIX extensions?

1 Like

Yes, I’ve read a number of such tutorials, but unfortunately I’m not very familiar with Java.

1 Like

But some things are very similar to Swift (Apple).

1 Like

Great first extension!
Have you considered having only one method that returns a List of both solutions of the equation?
You could do something like:

public YailList Calc(float a, float b, float c) {
  float x1 = /*YOUR CODE TO FIND THE FIRST SOLUTION*/;
  float x2 = /*YOUR CODE TO FIND THE SECOND SOLUTION*/;
  return YailList.makeList(new Object[] {x1, x2});
}
5 Likes

What IDE did you use? Appybuilder?

Yes, I tried, but I didn’t succeed. I will try again later.
Now the champagne is opened first. :wink:
Thanks for the tip!

2 Likes

I wrote the Java code with NotePad++ and use an extension template repository and apache-ant-1.10.7.

2 Likes

I updated the extension. Now the values x1, x2 are output in a list.
Thanks @Vishwas

1 Like

Love the extension!

Stay safe and keep Koding…

with Atom or VS Code :) :heart:

3 Likes