JSCL imported to C++
This commit is contained in:
84
jscl/src/test/java/jscl/JsclMathEngineTest.java
Normal file
84
jscl/src/test/java/jscl/JsclMathEngineTest.java
Normal file
@@ -0,0 +1,84 @@
|
||||
package jscl;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 12/15/11
|
||||
* Time: 11:25 AM
|
||||
*/
|
||||
public class JsclMathEngineTest {
|
||||
@Test
|
||||
public void testFormat() throws Exception {
|
||||
final MathContext me = JsclMathEngine.getInstance();
|
||||
|
||||
try {
|
||||
me.setUseGroupingSeparator(true);
|
||||
Assert.assertEquals("1", me.format(1d, NumeralBase.bin));
|
||||
Assert.assertEquals("10", me.format(2d, NumeralBase.bin));
|
||||
Assert.assertEquals("11", me.format(3d, NumeralBase.bin));
|
||||
Assert.assertEquals("100", me.format(4d, NumeralBase.bin));
|
||||
Assert.assertEquals("101", me.format(5d, NumeralBase.bin));
|
||||
Assert.assertEquals("110", me.format(6d, NumeralBase.bin));
|
||||
Assert.assertEquals("111", me.format(7d, NumeralBase.bin));
|
||||
Assert.assertEquals("1000", me.format(8d, NumeralBase.bin));
|
||||
Assert.assertEquals("1001", me.format(9d, NumeralBase.bin));
|
||||
Assert.assertEquals("1 0001", me.format(17d, NumeralBase.bin));
|
||||
Assert.assertEquals("1 0100", me.format(20d, NumeralBase.bin));
|
||||
Assert.assertEquals("1 0100", me.format(20d, NumeralBase.bin));
|
||||
Assert.assertEquals("1 1111", me.format(31d, NumeralBase.bin));
|
||||
|
||||
me.setRoundResult(true);
|
||||
me.setPrecision(10);
|
||||
|
||||
Assert.assertEquals("111 1111 0011 0110", me.format(32566d, NumeralBase.bin));
|
||||
Assert.assertEquals("100.0100 1100 11", me.format(4.3d, NumeralBase.bin));
|
||||
Assert.assertEquals("1 0001 0101 0011.0101 0101 10", me.format(4435.33423d, NumeralBase.bin));
|
||||
Assert.assertEquals("1100.0101 0101 01", me.format(12.3333d, NumeralBase.bin));
|
||||
Assert.assertEquals("1 0011 1101 1110 0100 0011 0101 0101.0001 1111 00", me.format(333333333.1212213321d, NumeralBase.bin));
|
||||
|
||||
Assert.assertEquals("0.EE EE EE EE EE", me.format(14d / 15d, NumeralBase.hex));
|
||||
Assert.assertEquals("7F 36", me.format(32566d, NumeralBase.hex));
|
||||
Assert.assertEquals("24", me.format(36d, NumeralBase.hex));
|
||||
Assert.assertEquals("8", me.format(8d, NumeralBase.hex));
|
||||
Assert.assertEquals("1 3D", me.format(317d, NumeralBase.hex));
|
||||
Assert.assertEquals("13 DE 43 55.1F 08 5B EF 14", me.format(333333333.1212213321d, NumeralBase.hex));
|
||||
Assert.assertEquals("D 25 0F 77 0A.6F 73 18 FC 50", me.format(56456345354.43534534523459999d, NumeralBase.hex));
|
||||
Assert.assertEquals("3 E7.4C CC CC CC CC", me.format(999.3d, NumeralBase.hex));
|
||||
|
||||
me.setRoundResult(false);
|
||||
Assert.assertEquals("0.00 00 00 00 00 00 00 00 00 6C", me.format(0.00000000000000000000009d, NumeralBase.hex));
|
||||
Assert.assertEquals("0.00 00 00 00 00 00 00 00 00 0A", me.format(0.000000000000000000000009d, NumeralBase.hex));
|
||||
|
||||
} finally {
|
||||
me.setUseGroupingSeparator(false);
|
||||
}
|
||||
|
||||
Assert.assertEquals("1", me.format(1d, NumeralBase.bin));
|
||||
Assert.assertEquals("10", me.format(2d, NumeralBase.bin));
|
||||
Assert.assertEquals("11", me.format(3d, NumeralBase.bin));
|
||||
Assert.assertEquals("100", me.format(4d, NumeralBase.bin));
|
||||
Assert.assertEquals("101", me.format(5d, NumeralBase.bin));
|
||||
Assert.assertEquals("110", me.format(6d, NumeralBase.bin));
|
||||
Assert.assertEquals("111", me.format(7d, NumeralBase.bin));
|
||||
Assert.assertEquals("1000", me.format(8d, NumeralBase.bin));
|
||||
Assert.assertEquals("1001", me.format(9d, NumeralBase.bin));
|
||||
Assert.assertEquals("10001", me.format(17d, NumeralBase.bin));
|
||||
Assert.assertEquals("10100", me.format(20d, NumeralBase.bin));
|
||||
Assert.assertEquals("10100", me.format(20d, NumeralBase.bin));
|
||||
Assert.assertEquals("11111", me.format(31d, NumeralBase.bin));
|
||||
Assert.assertEquals("111111100110110", me.format(32566d, NumeralBase.bin));
|
||||
|
||||
Assert.assertEquals("7F36", me.format(32566d, NumeralBase.hex));
|
||||
Assert.assertEquals("24", me.format(36d, NumeralBase.hex));
|
||||
Assert.assertEquals("8", me.format(8d, NumeralBase.hex));
|
||||
Assert.assertEquals("13D", me.format(317d, NumeralBase.hex));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPiComputation() throws Exception {
|
||||
final JsclMathEngine me = JsclMathEngine.getInstance();
|
||||
Assert.assertEquals("-1+122.46467991473532E-18*i", me.evaluate("exp(√(-1)*Π)"));
|
||||
}
|
||||
}
|
91
jscl/src/test/java/jscl/NumeralBaseTest.java
Normal file
91
jscl/src/test/java/jscl/NumeralBaseTest.java
Normal file
@@ -0,0 +1,91 @@
|
||||
package jscl;
|
||||
|
||||
import jscl.math.function.Constant;
|
||||
import jscl.math.function.ExtendedConstant;
|
||||
import jscl.math.function.IConstant;
|
||||
import jscl.text.ParseException;
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 11/29/11
|
||||
* Time: 12:20 PM
|
||||
*/
|
||||
public class NumeralBaseTest {
|
||||
|
||||
@Test
|
||||
public void testEvaluation() throws Exception {
|
||||
MathEngine me = JsclMathEngine.getInstance();
|
||||
|
||||
Assert.assertEquals("3", me.evaluate("0b:1+0b:10"));
|
||||
Assert.assertEquals("5", me.evaluate("0b:1+0b:100"));
|
||||
Assert.assertEquals("8", me.evaluate("0b:1+0b:100+(0b:1+0b:10)"));
|
||||
Assert.assertEquals("18", me.evaluate("0b:1+0b:100+(0b:1+0b:10)+10"));
|
||||
Assert.assertEquals("18.5", me.evaluate("0b:1+0b:100+(0b:1+0b:10)+10.5"));
|
||||
try {
|
||||
me.evaluate("0b:1+0b:100.+(0b:1+0b:10)+10.5");
|
||||
Assert.fail();
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
|
||||
try {
|
||||
me.evaluate("0b:1+0b:100E-2+(0b:1+0b:10)+10.5");
|
||||
Assert.fail();
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
|
||||
Assert.assertEquals("2748", me.evaluate("0x:ABC"));
|
||||
|
||||
try {
|
||||
me.evaluate("0x:");
|
||||
Assert.fail();
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
|
||||
Assert.assertEquals("0", me.evaluate("0x:0"));
|
||||
|
||||
IConstant constant = null;
|
||||
try {
|
||||
constant = me.getConstantsRegistry().add(new ExtendedConstant.Builder(new Constant("a"), 2d));
|
||||
Assert.assertEquals("2748", me.evaluate("0x:ABC"));
|
||||
Assert.assertEquals("5496", me.evaluate("0x:ABC*a"));
|
||||
Assert.assertEquals("27480", me.evaluate("0x:ABC*0x:A"));
|
||||
} finally {
|
||||
if (constant != null) {
|
||||
me.getConstantsRegistry().add(new ExtendedConstant.Builder(new Constant("a"), (String) null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNumeralBases() throws Exception {
|
||||
MathEngine me = JsclMathEngine.getInstance();
|
||||
|
||||
final NumeralBase defaultNumeralBase = me.getNumeralBase();
|
||||
try {
|
||||
me.setNumeralBase(NumeralBase.bin);
|
||||
Assert.assertEquals("∞", me.evaluate("∞"));
|
||||
Assert.assertEquals("-1011010+110101111.10000110101100011010*i", me.evaluate("asin(-1110100101)"));
|
||||
Assert.assertEquals("11", me.evaluate("0b:1+0b:10"));
|
||||
Assert.assertEquals("10", me.evaluate("0d:2"));
|
||||
Assert.assertEquals("11", me.evaluate("0d:3"));
|
||||
Assert.assertEquals("100", me.evaluate("0d:4"));
|
||||
Assert.assertEquals("11111111", me.evaluate("0d:255"));
|
||||
Assert.assertEquals("11", me.evaluate("1+10"));
|
||||
Assert.assertEquals("-1", me.evaluate("1-10"));
|
||||
Assert.assertEquals("11-i", me.evaluate("1+i+10-10*i"));
|
||||
Assert.assertEquals("11111110", me.evaluate("111001+11000101"));
|
||||
Assert.assertEquals("1101100100101111", me.evaluate("11011001001011110/10"));
|
||||
Assert.assertEquals("1001000011001010", me.evaluate("11011001001011110/11"));
|
||||
Assert.assertEquals("0.10101010101010101010", me.evaluate("10/11"));
|
||||
|
||||
me.setNumeralBase(NumeralBase.hex);
|
||||
org.junit.Assert.assertEquals("637B", me.evaluate("56CE+CAD"));
|
||||
org.junit.Assert.assertEquals("637B", me.simplify("56CE+CAD"));
|
||||
|
||||
} finally {
|
||||
me.setNumeralBase(defaultNumeralBase);
|
||||
}
|
||||
}
|
||||
}
|
833
jscl/src/test/java/jscl/math/ExpressionTest.java
Normal file
833
jscl/src/test/java/jscl/math/ExpressionTest.java
Normal file
@@ -0,0 +1,833 @@
|
||||
package jscl.math;
|
||||
|
||||
import jscl.AngleUnit;
|
||||
import jscl.JsclMathEngine;
|
||||
import jscl.MathEngine;
|
||||
import jscl.NumeralBase;
|
||||
import jscl.math.function.Constant;
|
||||
import jscl.math.function.ExtendedConstant;
|
||||
import jscl.math.function.IConstant;
|
||||
import jscl.text.ParseException;
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.util.Set;
|
||||
|
||||
import static junit.framework.Assert.fail;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 10/27/11
|
||||
* Time: 3:54 PM
|
||||
*/
|
||||
public class ExpressionTest {
|
||||
|
||||
private static final String expressions = "-24.37581129610191-((2699.798527427213-4032.781981216783)*√(4657.120529143301)/6202.47137988087-ln(4435.662292261872)*sin(5134.044125137488)-sin(5150.617980207194)+sin(1416.6029070906816))\n" +
|
||||
"1.6796699432963022E11-((5709.375015847543-√(9582.238699996864))*3622.6983393324695*8262.5649407951-4677.148654973858*ln(7443.120012194502)*ln(8771.583007058995)-7796.8909039525515)\n" +
|
||||
"73260.62134636212-(((8211.239143650871+9653.120869092472/7201.080677271473-3675.134705789929/sin(7383.23886608315))+sin(8201.936690357508)/9797.420229466312/4487.554672699577))\n" +
|
||||
"7835770.323315129-(3053.1562785415554*2564.6140313677965+ln(3376.462881190876)/2722.807595157415+cos(1654.053577173823)/4481.384989253306+cos(8539.28578313432)+5603.074520175994)\n" +
|
||||
"7.219848990044144E11-((((9742.199604684844*8637.637793906879)-8613.230244786755+√(1026.016931180783))*8580.654028379886+ln(391.54269092744664)/√(4341.52889100337))+sin(508.2338437131828))\n" +
|
||||
"6685.424634765305-((3746.8598111083793*sin(4784.284503822155)-ln(2218.167104685851)-sin(4794.102351616163))+3063.0457850324233-9545.89841181986/7482.886158430515/√(4001.7788453452417))\n" +
|
||||
"4108.351107289166-((4102.493099763215-cos(5125.896955144614))+cos(3540.5378825149537)/5495.082697662915-8681.097948569084/cos(8032.923414105565)/4501.859274666647-cos(2711.854814853617))\n" +
|
||||
"-1.0620650024203222-(((750.111466515082-9102.643276012855+3065.780766976849+2861.8661641038534)*3536.5716528042535/1106.4220238862831/7308.354645022433/sin(1173.0557272435349)))\n" +
|
||||
"76379.44709543366-(((9932.156860771898+ln(7185.939808298219)*7687.141207402175)+cos(8185.971595673607)+ln(3977.781005305916)+cos(2376.681088176604)*2201.8644681719-√(3135.5682620873513)))\n" +
|
||||
"635.3559760598341-((8075.628923197531/8255.66812901165+√(2936.433021287237)*sin(7502.632251185349)*sin(3225.272171990918)+613.2028126347367+ln(8485.99141046724))-cos(8518.190742544848))\n" +
|
||||
"-7.51034737891574E7-(4640.543920377892/√(4363.843503017953)*√(7152.285785189239)*sin(7908.617128515873)*√(6906.317696310425)*6562.864387786373/ln(4988.784292770342)-sin(5488.826440303076))\n" +
|
||||
"-5932.595870545627-(((3010.4402565484047-3218.3878293708044)+sin(9074.010686307622))/cos(7656.587621759453)/cos(1187.7115449548426)+cos(2207.5981975517957)/sin(7170.633198376899)+cos(129.16231777575283))\n" +
|
||||
"14603.51285508874-((1505.6670065700584-ln(7760.688872668162)-cos(1521.0119520475184)+5874.745001223881+sin(5672.757849045151)*sin(9740.028947007728)+7239.645067283123)-ln(1198.788813287901))\n" +
|
||||
"13789.681143529104-(4837.182498312745-sin(8683.238702053257)+9725.382455542274-ln(6866.318581911774)*√(7639.899860231787)-cos(8486.508690243441)/√(3325.7578426126165)/sin(5655.089763857597))\n" +
|
||||
"5.9142041337333955E7-((((6945.350108837433-6875.255304556105-5503.241468583639*ln(4882.916231493727)-8221.764146581652)*4816.727562192865)-47.13141200212378)*sin(7032.925165237175))\n" +
|
||||
"5.307098467139001E7-((((1472.5507104204128-2244.0144093640956)/337.94074333738934-6119.909773145814/4030.814210676087)+7955.59068044787)*6674.093078737379+cos(1072.8762639281485))\n" +
|
||||
"2.4791276864495695E8-(((4650.104984872984*5990.69176729321*ln(7326.221240600894)-√(4166.293207980269)-cos(2930.9607978551735))+4892.051672831694)-√(4643.4262014756005)*ln(4322.391733256239))\n" +
|
||||
"1.000473116354486E7-((1856.1678375267843*3375.5973472957558+8102.216834762455*460.5133278219642)+ln(1077.2976545272872)+9836.94091820254/cos(561.8742170542756)*sin(9587.941076809435))\n" +
|
||||
"1.043950271691602E7-((((3594.0668967195334*2903.435684617801-ln(431.72508853349336)+√(2631.9717706394795)+4315.178672680215)+sin(1034.406679999502)/cos(7200.345388541185))+sin(8030.470700471927)))\n" +
|
||||
"-4612.867091103858-(((117.31001770566519/6314.371065466436/5793.914918630644*1016.2707467350263*8539.984705173652)/3647.0016733225143*8871.091071924995-4680.559579608435))";
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println("Result: " + getWolframAlphaResult("APP_ID", "-24.37581129610191-((2699.798527427213-4032.781981216783)*√(4657.120529143301)/6202.47137988087-ln(4435.662292261872)*sin(5134.044125137488)-sin(5150.617980207194)+sin(1416.6029070906816))"));
|
||||
/*final StringTokenizer st = new StringTokenizer(expressions, "\n");
|
||||
if ( st.hasMoreTokens() ) {
|
||||
final String expression = st.nextToken();
|
||||
final String result = getWolframAlphaResult("APP_ID", expression);
|
||||
System.out.println("Expression: " + expression);
|
||||
System.out.println("Result: " + result);
|
||||
try {
|
||||
final Double value = Double.valueOf(result);
|
||||
} catch (NumberFormatException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static String getWolframAlphaResult(@Nonnull String appId, @Nonnull String expression) {
|
||||
String result = null;
|
||||
|
||||
URL wolframAlphaUrl;
|
||||
try {
|
||||
wolframAlphaUrl = new URL("http://api.wolframalpha.com/v2/query?input=" + expression + "&appid=" + appId + "&format=plaintext&podtitle=Decimal+approximation");
|
||||
|
||||
final URLConnection connection = wolframAlphaUrl.openConnection();
|
||||
BufferedReader in = null;
|
||||
try {
|
||||
in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
||||
|
||||
String line;
|
||||
while ((line = in.readLine()) != null) {
|
||||
System.out.println(line);
|
||||
if (line.contains("<plaintext>")) {
|
||||
result = line.replace("<plaintext>", "").replace("</plaintext>", "").replace("...", "").trim();
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testImag() throws Exception {
|
||||
Assert.assertEquals("-i", Expression.valueOf("i^3").numeric().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConstants() throws Exception {
|
||||
Assert.assertTrue(Expression.valueOf("3+4").getConstants().isEmpty());
|
||||
|
||||
Set<? extends Constant> constants = Expression.valueOf("3+4*t").getConstants();
|
||||
Assert.assertTrue(constants.size() == 1);
|
||||
Assert.assertTrue(constants.contains(new Constant("t")));
|
||||
|
||||
IConstant constant = null;
|
||||
|
||||
final JsclMathEngine me = JsclMathEngine.getInstance();
|
||||
try {
|
||||
constant = me.getConstantsRegistry().add(new ExtendedConstant.Builder(new Constant("t_0"), 1d));
|
||||
|
||||
constants = Expression.valueOf("3+4*t_0+t_0+t_1").getConstants();
|
||||
Assert.assertTrue(constants.size() == 2);
|
||||
Assert.assertTrue(constants.contains(new Constant("t_0")));
|
||||
Assert.assertTrue(constants.contains(new Constant("t_1")));
|
||||
|
||||
final Expression expression = Expression.valueOf("2*t_0+5*t_1");
|
||||
|
||||
Assert.assertEquals("7", expression.substitute(new Constant("t_1"), Expression.valueOf(1.0)).numeric().toString());
|
||||
Assert.assertEquals("12", expression.substitute(new Constant("t_1"), Expression.valueOf(2.0)).numeric().toString());
|
||||
Assert.assertEquals("27", expression.substitute(new Constant("t_1"), Expression.valueOf(5.0)).numeric().toString());
|
||||
|
||||
} finally {
|
||||
if (constant != null) {
|
||||
me.getConstantsRegistry().add(new ExtendedConstant.Builder(new Constant(constant.getName()), (String) null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testExpressions() throws Exception {
|
||||
Assert.assertEquals("3", Expression.valueOf("3").numeric().toString());
|
||||
Assert.assertEquals("0.6931471805599453", Expression.valueOf("ln(2)").numeric().toString());
|
||||
Assert.assertEquals("1", Expression.valueOf("lg(10)").numeric().toString());
|
||||
Assert.assertEquals("0", Expression.valueOf("eq(0, 1)").numeric().toString());
|
||||
Assert.assertEquals("1", Expression.valueOf("eq(1, 1)").numeric().toString());
|
||||
|
||||
Assert.assertEquals("24", Expression.valueOf("4!").numeric().toString());
|
||||
try {
|
||||
Expression.valueOf("(-3+2)!").numeric().toString();
|
||||
fail();
|
||||
} catch (ArithmeticException e) {
|
||||
|
||||
}
|
||||
Assert.assertEquals("24", Expression.valueOf("(2+2)!").numeric().toString());
|
||||
Assert.assertEquals("120", Expression.valueOf("(2+2+1)!").numeric().toString());
|
||||
Assert.assertEquals("24", Expression.valueOf("(2.0+2.0)!").numeric().toString());
|
||||
Assert.assertEquals("24", Expression.valueOf("4.0!").numeric().toString());
|
||||
Assert.assertEquals("48", Expression.valueOf("2*4.0!").numeric().toString());
|
||||
Assert.assertEquals("40320", Expression.valueOf("(2*4.0)!").numeric().toString());
|
||||
|
||||
final JsclMathEngine me = JsclMathEngine.getInstance();
|
||||
final AngleUnit angleUnits = me.getAngleUnits();
|
||||
try {
|
||||
me.setAngleUnits(AngleUnit.rad);
|
||||
Assert.assertEquals("-0.9055783620066238", Expression.valueOf("sin(4!)").numeric().toString());
|
||||
} finally {
|
||||
me.setAngleUnits(angleUnits);
|
||||
}
|
||||
Assert.assertEquals("1", Expression.valueOf("(3.14/3.14)!").numeric().toString());
|
||||
Assert.assertEquals("1", Expression.valueOf("2/2!").numeric().toString());
|
||||
try {
|
||||
Assert.assertEquals("3.141592653589793!", Expression.valueOf("3.141592653589793!").numeric().toString());
|
||||
fail();
|
||||
} catch (NotIntegerException e) {
|
||||
|
||||
}
|
||||
Assert.assertEquals("0.5235987755982988", Expression.valueOf("3.141592653589793/3!").numeric().toString());
|
||||
try {
|
||||
Assert.assertEquals("3.141592653589793/3.141592653589793!", Expression.valueOf("3.141592653589793/3.141592653589793!").numeric().toString());
|
||||
fail();
|
||||
} catch (ArithmeticException e) {
|
||||
|
||||
}
|
||||
try {
|
||||
Assert.assertEquals("7.2!", Expression.valueOf("7.2!").numeric().toString());
|
||||
fail();
|
||||
} catch (NotIntegerException e) {
|
||||
}
|
||||
|
||||
try {
|
||||
Assert.assertEquals("ln(7.2!)", Expression.valueOf("ln(7.2!)").numeric().toString());
|
||||
fail();
|
||||
} catch (NotIntegerException e) {
|
||||
}
|
||||
|
||||
Assert.assertEquals("ln(7.2!)", Expression.valueOf("ln(7.2!)").simplify().toString());
|
||||
|
||||
|
||||
Assert.assertEquals("36", Expression.valueOf("3!^2").numeric().toString());
|
||||
Assert.assertEquals("1", Expression.valueOf("(π/π)!").numeric().toString());
|
||||
Assert.assertEquals("720", Expression.valueOf("(3!)!").numeric().toString());
|
||||
Assert.assertEquals("36", Expression.valueOf("3!*3!").numeric().toString());
|
||||
|
||||
Assert.assertEquals("100", Expression.valueOf("0.1E3").numeric().toString());
|
||||
|
||||
final AngleUnit defaultAngleUnits = me.getAngleUnits();
|
||||
try {
|
||||
me.setAngleUnits(AngleUnit.rad);
|
||||
Assert.assertEquals("0.017453292519943295", Expression.valueOf("1°").numeric().toString());
|
||||
Assert.assertEquals("0.03490658503988659", Expression.valueOf("2°").numeric().toString());
|
||||
Assert.assertEquals("0.05235987755982989", Expression.valueOf("3°").numeric().toString());
|
||||
Assert.assertEquals("0.26179938779914946", Expression.valueOf("3°*5").numeric().toString());
|
||||
Assert.assertEquals("0.0027415567780803775", Expression.valueOf("3°^2").numeric().toString());
|
||||
Assert.assertEquals("0.01096622711232151", Expression.valueOf("3!°^2").numeric().toString());
|
||||
Assert.assertEquals("0.0009138522593601259", Expression.valueOf("3°°").numeric().toString());
|
||||
Assert.assertEquals("0.08726646259971647", Expression.valueOf("5°").numeric().toString());
|
||||
Assert.assertEquals("2.0523598775598297", Expression.valueOf("2+3°").numeric().toString());
|
||||
} finally {
|
||||
me.setAngleUnits(defaultAngleUnits);
|
||||
}
|
||||
|
||||
try {
|
||||
me.setAngleUnits(AngleUnit.deg);
|
||||
Assert.assertEquals("1", Expression.valueOf("1°").numeric().toString());
|
||||
Assert.assertEquals("2", Expression.valueOf("2°").numeric().toString());
|
||||
Assert.assertEquals("3", Expression.valueOf("3°").numeric().toString());
|
||||
Assert.assertEquals("15", Expression.valueOf("3°*5").numeric().toString());
|
||||
Assert.assertEquals("9", Expression.valueOf("3°^2").numeric().toString());
|
||||
Assert.assertEquals("36", Expression.valueOf("3!°^2").numeric().toString());
|
||||
Assert.assertEquals("3", Expression.valueOf("3°°").numeric().toString());
|
||||
Assert.assertEquals("5", Expression.valueOf("5°").numeric().toString());
|
||||
Assert.assertEquals("5", Expression.valueOf("2+3°").numeric().toString());
|
||||
} finally {
|
||||
me.setAngleUnits(defaultAngleUnits);
|
||||
}
|
||||
|
||||
Assert.assertEquals("6", Expression.valueOf("2*∂(3*x,x)").expand().toString());
|
||||
Assert.assertEquals("3", Expression.valueOf("∂(3*x,x)").expand().toString());
|
||||
Assert.assertEquals("12", Expression.valueOf("∂(x^3,x,2)").expand().toString());
|
||||
Assert.assertEquals("3*a", Expression.valueOf("∂(3*x*a,x)").expand().toString());
|
||||
Assert.assertEquals("0", Expression.valueOf("∂(3*x*a,x,0.011,2)").expand().toString());
|
||||
Assert.assertEquals("0", Expression.valueOf("2*∂(3*x*a,x,0.011,2)").expand().toString());
|
||||
Assert.assertEquals("ln(8)+lg(8)*ln(8)", Expression.valueOf("ln(8)*lg(8)+ln(8)").expand().toString());
|
||||
Assert.assertEquals("3.9573643765059856", Expression.valueOf("ln(8)*lg(8)+ln(8)").numeric().toString());
|
||||
|
||||
Assert.assertEquals("4!", Expression.valueOf("4.0!").simplify().toString());
|
||||
Assert.assertEquals("4°", Expression.valueOf("4.0°").simplify().toString());
|
||||
Assert.assertEquals("30°", Expression.valueOf("30°").simplify().toString());
|
||||
|
||||
|
||||
Assert.assertEquals("1", Expression.valueOf("abs(1)").numeric().toString());
|
||||
Assert.assertEquals("0", Expression.valueOf("abs(0)").numeric().toString());
|
||||
Assert.assertEquals("0", Expression.valueOf("abs(-0)").numeric().toString());
|
||||
Assert.assertEquals("1", Expression.valueOf("abs(-1)").numeric().toString());
|
||||
Assert.assertEquals("∞", Expression.valueOf("abs(-∞)").numeric().toString());
|
||||
|
||||
Assert.assertEquals("1", Expression.valueOf("abs(i)").numeric().toString());
|
||||
Assert.assertEquals("0", Expression.valueOf("abs(0+0*i)").numeric().toString());
|
||||
Assert.assertEquals("1", Expression.valueOf("abs(-i)").numeric().toString());
|
||||
Assert.assertEquals("2.23606797749979", Expression.valueOf("abs(2-i)").numeric().toString());
|
||||
Assert.assertEquals("2.23606797749979", Expression.valueOf("abs(2+i)").numeric().toString());
|
||||
Assert.assertEquals("2.8284271247461903", Expression.valueOf("abs(2+2*i)").numeric().toString());
|
||||
Assert.assertEquals("2.8284271247461903", Expression.valueOf("abs(2-2*i)").numeric().toString());
|
||||
|
||||
try {
|
||||
me.getConstantsRegistry().add(new ExtendedConstant.Builder(new Constant("k"), 2.8284271247461903));
|
||||
Assert.assertEquals("k", Expression.valueOf("k").numeric().toString());
|
||||
Assert.assertEquals("k", Expression.valueOf("k").simplify().toString());
|
||||
Assert.assertEquals("k", Expression.valueOf("k").simplify().toString());
|
||||
Assert.assertEquals("k^3", Expression.valueOf("k*k*k").simplify().toString());
|
||||
Assert.assertEquals("22.627416997969526", Expression.valueOf("k*k*k").numeric().toString());
|
||||
} finally {
|
||||
me.getConstantsRegistry().add(new ExtendedConstant.Builder(new Constant("k"), (String) null));
|
||||
}
|
||||
|
||||
try {
|
||||
me.getConstantsRegistry().add(new ExtendedConstant.Builder(new Constant("k_1"), 3d));
|
||||
Assert.assertEquals("k_1", Expression.valueOf("k_1").numeric().toString());
|
||||
Assert.assertEquals("k_1", Expression.valueOf("k_1[0]").numeric().toString());
|
||||
Assert.assertEquals("k_1", Expression.valueOf("k_1[2]").numeric().toString());
|
||||
} finally {
|
||||
me.getConstantsRegistry().add(new ExtendedConstant.Builder(new Constant("k_1"), (String) null));
|
||||
}
|
||||
|
||||
Generic expression = me.simplifyGeneric("cos(t)+∂(cos(t),t)");
|
||||
Generic substituted = expression.substitute(new Constant("t"), Expression.valueOf(100d));
|
||||
Assert.assertEquals("-1.1584559306791382", substituted.numeric().toString());
|
||||
|
||||
expression = me.simplifyGeneric("abs(t)^2+2!");
|
||||
substituted = expression.substitute(new Constant("t"), Expression.valueOf(10d));
|
||||
Assert.assertEquals("102", substituted.numeric().toString());
|
||||
|
||||
|
||||
expression = me.simplifyGeneric("abs(t)^2+10%");
|
||||
substituted = expression.substitute(new Constant("t"), Expression.valueOf(10d));
|
||||
Assert.assertEquals("110", substituted.numeric().toString());
|
||||
|
||||
expression = me.simplifyGeneric("abs(t)^2-10%");
|
||||
substituted = expression.substitute(new Constant("t"), Expression.valueOf(10d));
|
||||
Assert.assertEquals("90", substituted.numeric().toString());
|
||||
|
||||
expression = me.simplifyGeneric("(abs(t)^2)*10%");
|
||||
substituted = expression.substitute(new Constant("t"), Expression.valueOf(10d));
|
||||
Assert.assertEquals("10", substituted.numeric().toString());
|
||||
|
||||
expression = me.simplifyGeneric("(abs(t)^2)/10%");
|
||||
substituted = expression.substitute(new Constant("t"), Expression.valueOf(10d));
|
||||
Assert.assertEquals("1000", substituted.numeric().toString());
|
||||
|
||||
expression = me.simplifyGeneric("abs(t)^2+t%");
|
||||
substituted = expression.substitute(new Constant("t"), Expression.valueOf(10d));
|
||||
Assert.assertEquals("110", substituted.numeric().toString());
|
||||
|
||||
expression = me.simplifyGeneric("abs(t)^2-t%");
|
||||
substituted = expression.substitute(new Constant("t"), Expression.valueOf(10d));
|
||||
Assert.assertEquals("90", substituted.numeric().toString());
|
||||
|
||||
expression = me.simplifyGeneric("(abs(t)^2)*t%");
|
||||
substituted = expression.substitute(new Constant("t"), Expression.valueOf(10d));
|
||||
Assert.assertEquals("10", substituted.numeric().toString());
|
||||
|
||||
expression = me.simplifyGeneric("(abs(t)^2)/t%");
|
||||
substituted = expression.substitute(new Constant("t"), Expression.valueOf(10d));
|
||||
Assert.assertEquals("1000", substituted.numeric().toString());
|
||||
|
||||
expression = me.simplifyGeneric("Σ(t, t, 0, 10)");
|
||||
Assert.assertEquals("55", expression.numeric().toString());
|
||||
|
||||
expression = me.simplifyGeneric("Σ(t, t, 0, 10)");
|
||||
substituted = expression.substitute(new Constant("t"), Expression.valueOf(10d));
|
||||
Assert.assertEquals("55", substituted.numeric().toString());
|
||||
|
||||
expression = me.simplifyGeneric("10*Σ(t, t, 0, 10)");
|
||||
substituted = expression.substitute(new Constant("t"), Expression.valueOf(10d));
|
||||
Assert.assertEquals("550", substituted.numeric().toString());
|
||||
|
||||
expression = me.simplifyGeneric("t*Σ(t, t, 0, 10)");
|
||||
substituted = expression.substitute(new Constant("t"), Expression.valueOf(10d));
|
||||
Assert.assertEquals("550", substituted.numeric().toString());
|
||||
|
||||
expression = me.simplifyGeneric("t*Σ(t+100%, t, 0, 10)");
|
||||
substituted = expression.substitute(new Constant("t"), Expression.valueOf(10d));
|
||||
Assert.assertEquals("1100", substituted.numeric().toString());
|
||||
|
||||
Assert.assertEquals("i*t", Expression.valueOf("i*t").expand().simplify().toString());
|
||||
Assert.assertEquals("t", Expression.valueOf("t").simplify().toString());
|
||||
Assert.assertEquals("t^3", Expression.valueOf("t*t*t").simplify().toString());
|
||||
|
||||
try {
|
||||
Expression.valueOf("t").numeric();
|
||||
fail();
|
||||
} catch (ArithmeticException e) {
|
||||
}
|
||||
|
||||
me.getConstantsRegistry().add(new ExtendedConstant.Builder(new Constant("t"), (String) null));
|
||||
try {
|
||||
Expression.valueOf("t").numeric();
|
||||
fail();
|
||||
} catch (ArithmeticException e) {
|
||||
}
|
||||
|
||||
Assert.assertEquals("√(1+t)/(1+t)", Expression.valueOf("1/√(1+t)").simplify().toString());
|
||||
|
||||
Assert.assertEquals("t", Expression.valueOf("t").simplify().toString());
|
||||
Assert.assertEquals("t^3", Expression.valueOf("t*t*t").simplify().toString());
|
||||
|
||||
try {
|
||||
me.setAngleUnits(AngleUnit.rad);
|
||||
Assert.assertEquals("0.6931471805599453+Π*i", Expression.valueOf("ln(-2)").numeric().toString());
|
||||
} finally {
|
||||
me.setAngleUnits(AngleUnit.deg);
|
||||
}
|
||||
Assert.assertEquals("-2/57", Expression.valueOf("1/(-57/2)").simplify().toString());
|
||||
Assert.assertEquals("sin(30)", Expression.valueOf("sin(30)").expand().toString());
|
||||
Assert.assertEquals("sin(n)", Expression.valueOf("sin(n)").expand().toString());
|
||||
Assert.assertEquals("sin(n!)", Expression.valueOf("sin(n!)").expand().toString());
|
||||
Assert.assertEquals("sin(n°)", Expression.valueOf("sin(n°)").expand().toString());
|
||||
Assert.assertEquals("sin(30°)", Expression.valueOf("sin(30°)").expand().toString());
|
||||
Assert.assertEquals("0.49999999999999994", Expression.valueOf("sin(30°)").expand().numeric().toString());
|
||||
Assert.assertEquals("sin(2!)", Expression.valueOf("sin(2!)").expand().toString());
|
||||
|
||||
Assert.assertEquals("12", Expression.valueOf("3*(3+1)").expand().toString());
|
||||
Assert.assertEquals("114.59155902616465", Expression.valueOf("deg(2)").numeric().toString());
|
||||
try {
|
||||
Assert.assertEquals("-0.1425465430742778", Expression.valueOf("∏(tan(3))").numeric().toString());
|
||||
fail();
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
try {
|
||||
Assert.assertEquals("-0.14255", Expression.valueOf("sin(2,2)").expand().numeric().toString());
|
||||
fail();
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
try {
|
||||
Assert.assertEquals("114.59155902616465", Expression.valueOf("deg(2,2)").numeric().toString());
|
||||
fail();
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
|
||||
Assert.assertEquals("0.49999999999999994", Expression.valueOf("sin(30°)").numeric().toString());
|
||||
Assert.assertEquals("π", Expression.valueOf("√(π)^2").simplify().toString());
|
||||
Assert.assertEquals("π", Expression.valueOf("√(π^2)").simplify().toString());
|
||||
Assert.assertEquals("π^2", Expression.valueOf("√(π^2*π^2)").simplify().toString());
|
||||
Assert.assertEquals("π^3", Expression.valueOf("√(π^4*π^2)").simplify().toString());
|
||||
Assert.assertEquals("e*π^2", Expression.valueOf("√(π^4*e^2)").simplify().toString());
|
||||
|
||||
Assert.assertEquals("1", Expression.valueOf("(π/π)!").numeric().toString());
|
||||
|
||||
// in deg mode π=180 and factorial of 180 is calculating
|
||||
Assert.assertEquals("0", Expression.valueOf("Π/Π!").numeric().toString());
|
||||
|
||||
Assert.assertEquals("122.46467991473532E-18*i", Expression.valueOf("exp((Π*i))+1").numeric().toString());
|
||||
Assert.assertEquals("20*x^3", Expression.valueOf("∂(5*x^4, x)").expand().simplify().toString());
|
||||
Assert.assertEquals("25*x", Expression.valueOf("5*x*5").expand().simplify().toString());
|
||||
Assert.assertEquals("20*x", Expression.valueOf("5*x*4").expand().simplify().toString());
|
||||
|
||||
try {
|
||||
me.evaluate("0b:π");
|
||||
fail();
|
||||
} catch (ParseException e) {
|
||||
// ok
|
||||
}
|
||||
|
||||
try {
|
||||
me.evaluate("0b:10π");
|
||||
fail();
|
||||
} catch (ParseException e) {
|
||||
// ok
|
||||
}
|
||||
|
||||
try {
|
||||
me.setNumeralBase(NumeralBase.hex);
|
||||
|
||||
Assert.assertEquals("0.EEEEEEEEEEEEEC880AB7", me.evaluate("0x:E/0x:F"));
|
||||
Assert.assertEquals("E/F", me.simplify("0x:E/0x:F"));
|
||||
|
||||
Assert.assertEquals("0.EEEEEEEEEEEEEC880AB7", me.evaluate("E/F"));
|
||||
Assert.assertEquals("E/F", me.simplify("E/F"));
|
||||
|
||||
} finally {
|
||||
me.setNumeralBase(NumeralBase.dec);
|
||||
}
|
||||
|
||||
try {
|
||||
me.setAngleUnits(AngleUnit.rad);
|
||||
Assert.assertEquals("-1.5707963267948966+2.993222846126381*i", me.evaluate("asin(-10)"));
|
||||
Assert.assertEquals("-1.5707963267948966+1.3169578969248166*i", me.evaluate("asin(-2)"));
|
||||
Assert.assertEquals("-1.5707963267948966", me.evaluate("asin(-1)"));
|
||||
Assert.assertEquals("0", me.evaluate("asin(0)"));
|
||||
Assert.assertEquals("1.5707963267948966", me.evaluate("asin(1)"));
|
||||
Assert.assertEquals("1.5707963267948966-1.3169578969248166*i", me.evaluate("asin(2)"));
|
||||
Assert.assertEquals("1.5707963267948966-2.993222846126381*i", me.evaluate("asin(10)"));
|
||||
|
||||
Assert.assertEquals("Π-2.9932228461263786*i", me.evaluate("acos(-10)"));
|
||||
Assert.assertEquals("Π-1.3169578969248164*i", me.evaluate("acos(-2)"));
|
||||
Assert.assertEquals("Π", me.evaluate("acos(-1)"));
|
||||
Assert.assertEquals("1.5707963267948966", me.evaluate("acos(0)"));
|
||||
Assert.assertEquals("0", me.evaluate("acos(1)"));
|
||||
Assert.assertEquals("1.3169578969248164*i", me.evaluate("acos(2)"));
|
||||
Assert.assertEquals("2.9932228461263786*i", me.evaluate("acos(10)"));
|
||||
|
||||
Assert.assertEquals("-1.4711276743037347", me.evaluate("atan(-10)"));
|
||||
Assert.assertEquals("-1.1071487177940904", me.evaluate("atan(-2)"));
|
||||
Assert.assertEquals("-0.7853981633974483", me.evaluate("atan(-1)"));
|
||||
Assert.assertEquals("0", me.evaluate("atan(0)"));
|
||||
Assert.assertEquals("0.7853981633974483", me.evaluate("atan(1)"));
|
||||
Assert.assertEquals("1.1071487177940904", me.evaluate("atan(2)"));
|
||||
Assert.assertEquals("1.4711276743037347", me.evaluate("atan(10)"));
|
||||
|
||||
for (int i = -10; i < 10; i++) {
|
||||
Assert.assertEquals(me.evaluate("3.14159265358979323846/2 - atan(" + i + ")"), me.evaluate("acot(" + i + ")"));
|
||||
}
|
||||
|
||||
Assert.assertEquals("3.0419240010986313", me.evaluate("3.14159265358979323846/2 - atan(-10)"));
|
||||
Assert.assertEquals("3.0419240010986313", me.evaluate("acot(-10)"));
|
||||
Assert.assertEquals("1.5707963267948966", me.evaluate("acot(0)"));
|
||||
Assert.assertEquals("2.677945044588987", me.evaluate("acot(-2)"));
|
||||
Assert.assertEquals("2.356194490192345", me.evaluate("acot(-1)"));
|
||||
Assert.assertEquals("0.7853981633974483", me.evaluate("acot(1)"));
|
||||
Assert.assertEquals("0.46364760900080615", me.evaluate("acot(2)"));
|
||||
Assert.assertEquals("0.09966865249116186", me.evaluate("acot(10)"));
|
||||
|
||||
Assert.assertEquals("Π", me.evaluate("π"));
|
||||
Assert.assertEquals("Π", me.evaluate("3.14159265358979323846"));
|
||||
} finally {
|
||||
me.setAngleUnits(AngleUnit.deg);
|
||||
}
|
||||
|
||||
Assert.assertEquals("180", me.evaluate("Π"));
|
||||
Assert.assertEquals("180", me.evaluate("200-10%"));
|
||||
|
||||
Assert.assertEquals("∞", me.evaluate("1/0"));
|
||||
Assert.assertEquals("-∞", me.evaluate("-1/0"));
|
||||
Assert.assertEquals("-∞", me.evaluate("-1/0"));
|
||||
Assert.assertEquals("∞", me.evaluate("(1 + 2) / (5 - 3 - 2)"));
|
||||
Assert.assertEquals("∞", me.evaluate("(1 + 2) / (5.1 - 3.1 - 2.0 )"));
|
||||
Assert.assertEquals("∞", me.evaluate("1/0"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAngleUnits() throws Exception {
|
||||
final MathEngine mathEngine = JsclMathEngine.getInstance();
|
||||
|
||||
final AngleUnit defaultAngleUnits = mathEngine.getAngleUnits();
|
||||
|
||||
for (AngleUnit angleUnits : AngleUnit.values()) {
|
||||
try {
|
||||
mathEngine.setAngleUnits(angleUnits);
|
||||
mathEngine.evaluate("sin(2)");
|
||||
mathEngine.evaluate("asin(2)");
|
||||
} finally {
|
||||
mathEngine.setAngleUnits(defaultAngleUnits);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
mathEngine.setAngleUnits(AngleUnit.rad);
|
||||
Assert.assertEquals("Π", mathEngine.evaluate("π"));
|
||||
Assert.assertEquals("π/2", mathEngine.simplify("π/2"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0.9092974268256816953960198659117448427022549714478902683789"), mathEngine.evaluate("sin(2)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0.1411200080598672221007448028081102798469332642522655841518"), mathEngine.evaluate("sin(3)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0"), mathEngine.evaluate("sin(0)"));
|
||||
|
||||
Assert.assertEquals(mathEngine.evaluate("1"), mathEngine.evaluate("cos(0)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0.8623188722876839341019385139508425355100840085355108292801"), mathEngine.evaluate("cos(100)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("-0.416146836547142386997568229500762189766000771075544890755"), mathEngine.evaluate("cos(2)"));
|
||||
|
||||
Assert.assertEquals(mathEngine.evaluate("-2.185039863261518991643306102313682543432017746227663164562"), mathEngine.evaluate("tan(2)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("-0.142546543074277805295635410533913493226092284901804647633"), mathEngine.evaluate("tan(3)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0.6483608274590872"), mathEngine.evaluate("tan(10)"));
|
||||
|
||||
Assert.assertEquals(mathEngine.evaluate("0.6420926159343306"), mathEngine.evaluate("cot(1)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("-0.457657554360285763750277410432047276428486329231674329641"), mathEngine.evaluate("cot(2)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("-7.015252551434533469428551379526476578293103352096353838156"), mathEngine.evaluate("cot(3)"));
|
||||
} finally {
|
||||
mathEngine.setAngleUnits(defaultAngleUnits);
|
||||
}
|
||||
|
||||
try {
|
||||
mathEngine.setAngleUnits(AngleUnit.deg);
|
||||
Assert.assertEquals(mathEngine.evaluate("0.9092974268256816953960198659117448427022549714478902683789"), mathEngine.evaluate("sin(deg(2))"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0.1411200080598672221007448028081102798469332642522655841518"), mathEngine.evaluate("sin(deg(3))"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0"), mathEngine.evaluate("sin(deg(0))"));
|
||||
|
||||
Assert.assertEquals(mathEngine.evaluate("1"), mathEngine.evaluate("cos(deg(0))"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0.8623188722876839341019385139508425355100840085355108292801"), mathEngine.evaluate("cos(deg(100))"));
|
||||
Assert.assertEquals(mathEngine.evaluate("-0.416146836547142386997568229500762189766000771075544890755"), mathEngine.evaluate("cos(deg(2))"));
|
||||
|
||||
Assert.assertEquals(mathEngine.evaluate("-2.185039863261518991643306102313682543432017746227663164562"), mathEngine.evaluate("tan(deg(2))"));
|
||||
Assert.assertEquals(mathEngine.evaluate("-0.142546543074277805295635410533913493226092284901804647633"), mathEngine.evaluate("tan(deg(3))"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0.6483608274590872"), mathEngine.evaluate("tan(deg(10))"));
|
||||
|
||||
Assert.assertEquals(mathEngine.evaluate("0.6420926159343306"), mathEngine.evaluate("cot(deg(1))"));
|
||||
Assert.assertEquals(mathEngine.evaluate("-0.457657554360285763750277410432047276428486329231674329641"), mathEngine.evaluate("cot(deg(2))"));
|
||||
Assert.assertEquals(mathEngine.evaluate("-7.015252551434533469428551379526476578293103352096353838156"), mathEngine.evaluate("cot(deg(3))"));
|
||||
} finally {
|
||||
mathEngine.setAngleUnits(defaultAngleUnits);
|
||||
}
|
||||
|
||||
try {
|
||||
mathEngine.setAngleUnits(AngleUnit.rad);
|
||||
Assert.assertEquals(mathEngine.evaluate("-0.5235987755982989"), mathEngine.evaluate("asin(-0.5)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("-0.47349551215005636"), mathEngine.evaluate("asin(-0.456)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0.32784124364198347"), mathEngine.evaluate("asin(0.322)"));
|
||||
|
||||
Assert.assertEquals(mathEngine.evaluate("1.2429550831529133"), mathEngine.evaluate("acos(0.322)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("1.5587960387762325"), mathEngine.evaluate("acos(0.012)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("1.6709637479564563"), mathEngine.evaluate("acos(-0.1)"));
|
||||
|
||||
Assert.assertEquals(mathEngine.evaluate("0.3805063771123649"), mathEngine.evaluate("atan(0.4)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0.09966865249116204"), mathEngine.evaluate("atan(0.1)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("-0.5404195002705842"), mathEngine.evaluate("atan(-0.6)"));
|
||||
|
||||
Assert.assertEquals(mathEngine.evaluate("1.0603080048781206"), mathEngine.evaluate("acot(0.56)"));
|
||||
// todo serso: wolfram alpha returns -0.790423 instead of 2.3511694068615325 (-PI)
|
||||
Assert.assertEquals(mathEngine.evaluate("2.3511694068615325"), mathEngine.evaluate("acot(-0.99)"));
|
||||
// todo serso: wolfram alpha returns -1.373401 instead of 1.7681918866447774 (-PI)
|
||||
Assert.assertEquals(mathEngine.evaluate("1.7681918866447774"), mathEngine.evaluate("acot(-0.2)"));
|
||||
} finally {
|
||||
mathEngine.setAngleUnits(defaultAngleUnits);
|
||||
}
|
||||
|
||||
try {
|
||||
mathEngine.setAngleUnits(AngleUnit.deg);
|
||||
Assert.assertEquals(mathEngine.evaluate("deg(-0.5235987755982989)"), mathEngine.evaluate("asin(-0.5)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("-27.129294464583623"), mathEngine.evaluate("asin(-0.456)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("18.783919611005786"), mathEngine.evaluate("asin(0.322)"));
|
||||
|
||||
Assert.assertEquals(mathEngine.evaluate("71.21608038899423"), mathEngine.evaluate("acos(0.322)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("89.31243414358914"), mathEngine.evaluate("acos(0.012)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("95.73917047726678"), mathEngine.evaluate("acos(-0.1)"));
|
||||
|
||||
Assert.assertEquals(mathEngine.evaluate("deg(0.3805063771123649)"), mathEngine.evaluate("atan(0.4)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("deg(0.09966865249116204)"), mathEngine.evaluate("atan(0.1)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("deg(-0.5404195002705842)"), mathEngine.evaluate("atan(-0.6)"));
|
||||
|
||||
Assert.assertEquals(mathEngine.evaluate("deg(1.0603080048781206)"), mathEngine.evaluate("acot(0.56)"));
|
||||
// todo serso: wolfram alpha returns -0.790423 instead of 2.3511694068615325 (-PI)
|
||||
Assert.assertEquals(mathEngine.evaluate("134.7120839334429"), mathEngine.evaluate("acot(-0.99)"));
|
||||
// todo serso: wolfram alpha returns -1.373401 instead of 1.7681918866447774 (-PI)
|
||||
Assert.assertEquals(mathEngine.evaluate("deg(1.7681918866447774)"), mathEngine.evaluate("acot(-0.2)"));
|
||||
} finally {
|
||||
mathEngine.setAngleUnits(defaultAngleUnits);
|
||||
}
|
||||
|
||||
try {
|
||||
mathEngine.setAngleUnits(AngleUnit.deg);
|
||||
Assert.assertEquals(mathEngine.evaluate("0.0348994967025009716459951816253329373548245760432968714250"), mathEngine.evaluate("(sin(2))"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0.0523359562429438327221186296090784187310182539401649204835"), mathEngine.evaluate("(sin(3))"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0"), mathEngine.evaluate("sin(0)"));
|
||||
|
||||
Assert.assertEquals(mathEngine.evaluate("1"), mathEngine.evaluate("cos(0)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("-0.1736481776669303"), mathEngine.evaluate("(cos(100))"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0.9993908270190958"), mathEngine.evaluate("(cos(2))"));
|
||||
|
||||
Assert.assertEquals(mathEngine.evaluate("0.03492076949174773"), mathEngine.evaluate("(tan(2))"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0.05240777928304121"), mathEngine.evaluate("(tan(3))"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0.17632698070846498"), mathEngine.evaluate("(tan(10))"));
|
||||
|
||||
Assert.assertEquals(mathEngine.evaluate("57.28996163075943"), mathEngine.evaluate("(cot(1))"));
|
||||
Assert.assertEquals(mathEngine.evaluate("28.636253282915604"), mathEngine.evaluate("(cot(2))"));
|
||||
Assert.assertEquals(mathEngine.evaluate("19.081136687728208"), mathEngine.evaluate("(cot(3))"));
|
||||
} finally {
|
||||
mathEngine.setAngleUnits(defaultAngleUnits);
|
||||
}
|
||||
|
||||
try {
|
||||
mathEngine.setAngleUnits(AngleUnit.rad);
|
||||
testSinEqualsToSinh(mathEngine, 0d);
|
||||
testSinEqualsToSinh(mathEngine, 1d, "0.8414709848078965");
|
||||
testSinEqualsToSinh(mathEngine, 3d, "0.1411200080598672");
|
||||
testSinEqualsToSinh(mathEngine, 6d);
|
||||
testSinEqualsToSinh(mathEngine, -1d, "-0.8414709848078965");
|
||||
testSinEqualsToSinh(mathEngine, -3.3d, "0.1577456941432482");
|
||||
testSinEqualsToSinh(mathEngine, -232.2d, "0.27429486373689577");
|
||||
} finally {
|
||||
mathEngine.setAngleUnits(defaultAngleUnits);
|
||||
}
|
||||
|
||||
try {
|
||||
mathEngine.setAngleUnits(AngleUnit.deg);
|
||||
testSinEqualsToSinh(mathEngine, 0d);
|
||||
testSinEqualsToSinh(mathEngine, 1d, "0.01745240643728351");
|
||||
testSinEqualsToSinh(mathEngine, 3d, "0.052335956242943835");
|
||||
testSinEqualsToSinh(mathEngine, 6d, "0.10452846326765347");
|
||||
testSinEqualsToSinh(mathEngine, -1d, "-0.01745240643728351");
|
||||
testSinEqualsToSinh(mathEngine, -3.3d, "-0.05756402695956728");
|
||||
testSinEqualsToSinh(mathEngine, -232.2d, "0.7901550123756904");
|
||||
Assert.assertEquals("Π/2", mathEngine.simplify("Π/2"));
|
||||
} finally {
|
||||
mathEngine.setAngleUnits(defaultAngleUnits);
|
||||
}
|
||||
|
||||
try {
|
||||
mathEngine.setAngleUnits(AngleUnit.rad);
|
||||
Assert.assertEquals(mathEngine.evaluate("1.5707963267948966-0.8813735870195429*i"), mathEngine.evaluate("acos(i)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0.9045568943023814-1.0612750619050357*i"), mathEngine.evaluate("acos(1+i)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("0.9999999999999999-0.9999999999999998*i"), mathEngine.evaluate("cos(acos(1-i))"));
|
||||
Assert.assertEquals(mathEngine.evaluate("-0.9045568943023814-1.0612750619050355*i"), mathEngine.evaluate("-acos(1-i)"));
|
||||
} finally {
|
||||
mathEngine.setAngleUnits(defaultAngleUnits);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void testSinEqualsToSinh(@Nonnull MathEngine mathEngine, @Nonnull Double x) throws ParseException {
|
||||
testSinEqualsToSinh(mathEngine, x, null);
|
||||
}
|
||||
|
||||
private void testSinEqualsToSinh(@Nonnull MathEngine mathEngine, @Nonnull Double x, @Nullable String expected) throws ParseException {
|
||||
if (expected == null) {
|
||||
Assert.assertEquals(mathEngine.evaluate("sinh(i*" + x + ")/i"), mathEngine.evaluate("sin(" + x + ")"));
|
||||
// Assert.assertEquals(mathEngine.evaluate("exp("+x+")-sinh(" + x + ")"), mathEngine.evaluate("cosh(" + x + ")"));
|
||||
} else {
|
||||
Assert.assertEquals(expected, mathEngine.evaluate("sin(" + x + ")"));
|
||||
Assert.assertEquals(expected, mathEngine.evaluate("(exp(i * " + x + ") - cos(" + x + "))/i"));
|
||||
Assert.assertEquals(expected, mathEngine.evaluate("(exp(i * " + x + ") - cos(" + x + "))/i"));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testName() throws Exception {
|
||||
Expression.valueOf("a*c+b*sin(c)").toString();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testIntegrals() throws Exception {
|
||||
Assert.assertEquals("50", Expression.valueOf("∫ab(x, x, 0, 10)").expand().numeric().toString());
|
||||
Assert.assertEquals("1/2*a^2", Expression.valueOf("∫ab(x, x, 0, a)").expand().toString());
|
||||
try {
|
||||
Assert.assertEquals("∫ab(x, x, 0)", Expression.valueOf("∫ab(x, x, 0)").expand().toString());
|
||||
fail();
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
try {
|
||||
Assert.assertEquals("∫ab(x, x)", Expression.valueOf("∫ab(x, x)").expand().simplify().toString());
|
||||
fail();
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
Assert.assertEquals("x^2/2", Expression.valueOf("∫(x, x)").expand().simplify().toString());
|
||||
try {
|
||||
Assert.assertEquals("x^2/2", Expression.valueOf("∫(x, x)").expand().numeric().toString());
|
||||
fail();
|
||||
} catch (ArithmeticException e) {
|
||||
}
|
||||
|
||||
Assert.assertEquals("x^2/2", Expression.valueOf("∫(x, x)").expand().simplify().toString());
|
||||
Assert.assertEquals("ln(x)", Expression.valueOf("∫(1/x, x)").expand().simplify().toString());
|
||||
try {
|
||||
JsclMathEngine.getInstance().setAngleUnits(AngleUnit.rad);
|
||||
Assert.assertEquals("2*ln(2)+ln(cosh(x))", Expression.valueOf("∫(tanh(x), x)").expand().simplify().toString());
|
||||
Assert.assertEquals("2*ln(2)+ln(sin(x))", Expression.valueOf("∫(cot(x), x)").expand().simplify().toString());
|
||||
Assert.assertEquals("-2*ln(2)-ln(cos(x))", Expression.valueOf("∫(tan(x), x)").expand().simplify().toString());
|
||||
} finally {
|
||||
JsclMathEngine.getInstance().setAngleUnits(AngleUnit.deg);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDerivations() throws Exception {
|
||||
final AngleUnit defaultAngleUnits = JsclMathEngine.getInstance().getAngleUnits();
|
||||
try {
|
||||
JsclMathEngine.getInstance().setAngleUnits(AngleUnit.rad);
|
||||
Assert.assertEquals("-0.9092974268256817", Expression.valueOf("∂(cos(t),t,2)").numeric().toString());
|
||||
Assert.assertEquals("∂(cos(t), t, 2, 1)", Expression.valueOf("∂(cos(t),t,2)").simplify().toString());
|
||||
Assert.assertEquals("-2.234741690198506", Expression.valueOf("∂(t*cos(t),t,2)").numeric().toString());
|
||||
Assert.assertEquals("-4.469483380397012", Expression.valueOf("2*∂(t*cos(t),t,2)").numeric().toString());
|
||||
Assert.assertEquals("-sin(2)", Expression.valueOf("∂(cos(t),t,2)").expand().toString());
|
||||
Assert.assertEquals("-sin(t)", Expression.valueOf("∂(cos(t),t)").expand().toString());
|
||||
assertEquals("-sin(t)", Expression.valueOf("∂(cos(t),t,t,1)").expand().simplify().toString());
|
||||
assertEquals("∂(cos(t), t, t, 1°)", Expression.valueOf("∂(cos(t),t,t,1°)").expand().simplify().toString());
|
||||
} finally {
|
||||
JsclMathEngine.getInstance().setAngleUnits(defaultAngleUnits);
|
||||
}
|
||||
|
||||
assertEquals("∂(cos(t), t, t, 1°)", Expression.valueOf("∂(cos(t),t,t,1°)").expand().numeric().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSum() throws Exception {
|
||||
Assert.assertEquals("3", Expression.valueOf("Σ(n,n,1,2)").expand().toString());
|
||||
Assert.assertEquals("200", Expression.valueOf("Σ(n/n,n,1,200)").expand().toString());
|
||||
Assert.assertEquals("1/3", Expression.valueOf("Σ((n-1)/(n+1),n,1,2)").expand().toString());
|
||||
Assert.assertEquals("sin(1)", Expression.valueOf("Σ(sin(n),n,1,1)").expand().toString());
|
||||
Assert.assertEquals("1/1!", Expression.valueOf("Σ(n/n!,n,1,1)").expand().toString());
|
||||
Assert.assertEquals("2", Expression.valueOf("Σ(n/n!,n,1,2)").expand().numeric().toString());
|
||||
Assert.assertEquals("2.7182818284590455", Expression.valueOf("Σ(n/n!,n,1,200)").expand().numeric().toString());
|
||||
Assert.assertEquals("2.718281828459046", Expression.valueOf("Σ(n/(2*n/2)!,n,1,200)").expand().numeric().toString());
|
||||
Assert.assertEquals(Expression.valueOf("3").numeric().toString(), Expression.valueOf("Σ(n°,n,1,2)").expand().numeric().toString());
|
||||
Assert.assertEquals("200", Expression.valueOf("Σ(n°/n°,n,1,200)").expand().numeric().toString());
|
||||
Assert.assertEquals("-sin(1)-sin(2)", Expression.valueOf("Σ(∂(cos(t),t,n),n,1,2)").expand().toString());
|
||||
Assert.assertEquals("-0.05235190313978448", Expression.valueOf("Σ(∂(cos(t),t,n),n,1,2)").expand().numeric().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNumeralBases() throws Exception {
|
||||
final JsclMathEngine me = JsclMathEngine.getInstance();
|
||||
//final NumeralBase defaultNumeralBase = me.getDefaultNumeralBase();
|
||||
try {
|
||||
//me.setDefaultNumeralBase(NumeralBase.bin);
|
||||
Assert.assertEquals("10", me.evaluate("0b:01010"));
|
||||
Assert.assertEquals("10", me.evaluate("0b:1010"));
|
||||
Assert.assertEquals("520", me.evaluate("0o:1010"));
|
||||
Assert.assertEquals("1010", me.evaluate("1010"));
|
||||
Assert.assertEquals("1010.1", me.evaluate("1010.1"));
|
||||
} finally {
|
||||
//me.setDefaultNumeralBase(defaultNumeralBase);
|
||||
}
|
||||
|
||||
try {
|
||||
me.setNumeralBase(NumeralBase.hex);
|
||||
Assert.assertEquals("22F", me.evaluate("22F*exp(F)/exp(F)"));
|
||||
Assert.assertEquals("E", me.evaluate("E"));
|
||||
} finally {
|
||||
me.setNumeralBase(NumeralBase.dec);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFormat() throws Exception {
|
||||
final JsclMathEngine me = JsclMathEngine.getInstance();
|
||||
try {
|
||||
me.setUseGroupingSeparator(true);
|
||||
Assert.assertEquals("123 456.7891011", Expression.valueOf("123456.7891011").numeric().toString());
|
||||
Assert.assertEquals("123 456.7891011", Expression.valueOf("123456.7891011").simplify().toString());
|
||||
Assert.assertEquals("123 456.78910111231", Expression.valueOf("123456.7891011123123123123123").simplify().toString());
|
||||
Assert.assertEquals("1.222E-6", Expression.valueOf("1222/(10^9)").numeric().toString());
|
||||
Assert.assertEquals("12 345", JsclInteger.valueOf(12345L).toString());
|
||||
|
||||
me.setScienceNotation(true);
|
||||
Assert.assertEquals("0", Expression.valueOf("0.0").simplify().toString());
|
||||
Assert.assertEquals("1E0", Expression.valueOf("1.0").simplify().toString());
|
||||
Assert.assertEquals("100E0", Expression.valueOf("100.0").simplify().toString());
|
||||
|
||||
me.setRoundResult(true);
|
||||
me.setPrecision(5);
|
||||
Assert.assertEquals("0", Expression.valueOf("1222/(10^9)").numeric().toString());
|
||||
|
||||
me.setRoundResult(true);
|
||||
me.setPrecision(10);
|
||||
Assert.assertEquals("1.222E-6", Expression.valueOf("1222/(10^9)").numeric().toString());
|
||||
|
||||
me.setRoundResult(false);
|
||||
Assert.assertEquals("1.222E-6", Expression.valueOf("1222/(10^9)").numeric().toString());
|
||||
|
||||
me.setScienceNotation(false);
|
||||
Assert.assertEquals("0.3333333333333333", Expression.valueOf("1/3").numeric().toString());
|
||||
|
||||
me.setScienceNotation(true);
|
||||
Assert.assertEquals("333.33333E-3", Expression.valueOf("1/3").numeric().toString());
|
||||
|
||||
me.setRoundResult(true);
|
||||
me.setPrecision(10);
|
||||
Assert.assertEquals("333.33333E-3", Expression.valueOf("1/3").numeric().toString());
|
||||
|
||||
me.setScienceNotation(false);
|
||||
me.setRoundResult(true);
|
||||
me.setPrecision(10);
|
||||
Assert.assertEquals("0.3333333333", Expression.valueOf("1/3").numeric().toString());
|
||||
|
||||
} finally {
|
||||
me.setUseGroupingSeparator(false);
|
||||
me.setScienceNotation(false);
|
||||
me.setRoundResult(false);
|
||||
}
|
||||
}
|
||||
}
|
20
jscl/src/test/java/jscl/math/JsclVectorTest.java
Normal file
20
jscl/src/test/java/jscl/math/JsclVectorTest.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package jscl.math;
|
||||
|
||||
import jscl.JsclMathEngine;
|
||||
import jscl.MathEngine;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 12/26/11
|
||||
* Time: 9:52 AM
|
||||
*/
|
||||
public class JsclVectorTest {
|
||||
|
||||
@Test
|
||||
public void testVector() throws Exception {
|
||||
MathEngine me = JsclMathEngine.getInstance();
|
||||
Assert.assertEquals("[1, 0, 0, 1]", me.evaluate("[1, 0, 0, 1]"));
|
||||
}
|
||||
}
|
38
jscl/src/test/java/jscl/math/LiteralTest.java
Normal file
38
jscl/src/test/java/jscl/math/LiteralTest.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package jscl.math;
|
||||
|
||||
import jscl.math.numeric.Real;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 12/23/11
|
||||
* Time: 5:28 PM
|
||||
*/
|
||||
public class LiteralTest {
|
||||
@Test
|
||||
public void testGcd() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testScm() throws Exception {
|
||||
Expression e1 = Expression.valueOf("2+sin(2)");
|
||||
Expression e2 = Expression.valueOf("3+cos(2)");
|
||||
Literal l1 = Literal.valueOf(new DoubleVariable(new NumericWrapper(Real.valueOf(2d))));
|
||||
Literal l2 = Literal.valueOf(new DoubleVariable(new NumericWrapper(Real.valueOf(4d))));
|
||||
|
||||
System.out.println(e1);
|
||||
System.out.println(e2);
|
||||
|
||||
Literal result = Literal.newInstance();
|
||||
System.out.println(-1 + " -> " + result);
|
||||
for (int i = 0; i < e1.size(); i++) {
|
||||
result = result.scm(e1.literal(i));
|
||||
System.out.println(i + " -> " + result);
|
||||
}
|
||||
|
||||
System.out.println(e1.literalScm());
|
||||
System.out.println(e2.literalScm());
|
||||
|
||||
}
|
||||
}
|
134
jscl/src/test/java/jscl/math/NumeralBaseConversionTest.java
Normal file
134
jscl/src/test/java/jscl/math/NumeralBaseConversionTest.java
Normal file
@@ -0,0 +1,134 @@
|
||||
package jscl.math;
|
||||
|
||||
import au.com.bytecode.opencsv.CSVReader;
|
||||
import jscl.JsclMathEngine;
|
||||
import jscl.MathEngine;
|
||||
import jscl.text.ParseException;
|
||||
import jscl.util.ExpressionGeneratorWithInput;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.solovyev.common.Converter;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 12/14/11
|
||||
* Time: 4:01 PM
|
||||
*/
|
||||
public class NumeralBaseConversionTest {
|
||||
|
||||
public static void testExpression(@Nonnull String[] line, @Nonnull Converter<String, String> converter) throws ParseException {
|
||||
final String dec = line[0].toUpperCase();
|
||||
final String hex = "0x:" + line[1].toUpperCase();
|
||||
final String bin = "0b:" + line[2].toUpperCase();
|
||||
|
||||
final String decResult = Expression.valueOf(converter.convert(dec)).numeric().toString();
|
||||
final String hexResult = Expression.valueOf(converter.convert(hex)).numeric().toString();
|
||||
final String binResult = Expression.valueOf(converter.convert(bin)).numeric().toString();
|
||||
|
||||
Assert.assertEquals(decResult, hexResult);
|
||||
Assert.assertEquals(decResult, binResult);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testConversion() throws Exception {
|
||||
CSVReader reader = null;
|
||||
try {
|
||||
final MathEngine me = JsclMathEngine.getInstance();
|
||||
|
||||
reader = new CSVReader(new InputStreamReader(NumeralBaseConversionTest.class.getResourceAsStream("/jscl/math/nb_table.csv")), '\t');
|
||||
|
||||
// skip first line
|
||||
reader.readNext();
|
||||
|
||||
String[] line = reader.readNext();
|
||||
for (; line != null; line = reader.readNext()) {
|
||||
testExpression(line, new DummyExpression());
|
||||
testExpression(line, new Expression1());
|
||||
testExpression(line, new Expression2());
|
||||
testExpression(line, new Expression3());
|
||||
|
||||
final String dec = line[0].toUpperCase();
|
||||
final String hex = "0x:" + line[1].toUpperCase();
|
||||
final String bin = "0b:" + line[2].toUpperCase();
|
||||
|
||||
final List<String> input = new ArrayList<String>();
|
||||
input.add(dec);
|
||||
input.add(hex);
|
||||
input.add(bin);
|
||||
|
||||
//System.out.println("Dec: " + dec);
|
||||
//System.out.println("Hex: " + hex);
|
||||
//System.out.println("Bin: " + bin);
|
||||
|
||||
final ExpressionGeneratorWithInput eg = new ExpressionGeneratorWithInput(input, 20);
|
||||
final List<String> expressions = eg.generate();
|
||||
|
||||
final String decExpression = expressions.get(0);
|
||||
final String hexExpression = expressions.get(1);
|
||||
final String binExpression = expressions.get(2);
|
||||
|
||||
//System.out.println("Dec expression: " + decExpression);
|
||||
//System.out.println("Hex expression: " + hexExpression);
|
||||
//System.out.println("Bin expression: " + binExpression);
|
||||
|
||||
final String decResult = Expression.valueOf(decExpression).numeric().toString();
|
||||
//System.out.println("Dec result: " + decResult);
|
||||
|
||||
final String hexResult = Expression.valueOf(hexExpression).numeric().toString();
|
||||
//System.out.println("Hex result: " + hexResult);
|
||||
|
||||
final String binResult = Expression.valueOf(binExpression).numeric().toString();
|
||||
//System.out.println("Bin result: " + binResult);
|
||||
|
||||
Assert.assertEquals("dec-hex: " + decExpression + " : " + hexExpression, decResult, hexResult);
|
||||
Assert.assertEquals("dec-bin: " + decExpression + " : " + binExpression, decResult, binResult);
|
||||
|
||||
}
|
||||
} finally {
|
||||
if (reader != null) {
|
||||
reader.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class DummyExpression implements Converter<String, String> {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String convert(@Nonnull String s) {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
private static class Expression1 implements Converter<String, String> {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String convert(@Nonnull String s) {
|
||||
return s + "*" + s;
|
||||
}
|
||||
}
|
||||
|
||||
private static class Expression2 implements Converter<String, String> {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String convert(@Nonnull String s) {
|
||||
return s + "*" + s + " * sin(" + s + ") - 0b:1101";
|
||||
}
|
||||
}
|
||||
|
||||
private static class Expression3 implements Converter<String, String> {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String convert(@Nonnull String s) {
|
||||
return s + "*" + s + " * sin(" + s + ") - 0b:1101 + √(" + s + ") + exp ( " + s + ")";
|
||||
}
|
||||
}
|
||||
}
|
29
jscl/src/test/java/jscl/math/RandomExpressionTest.java
Normal file
29
jscl/src/test/java/jscl/math/RandomExpressionTest.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package jscl.math;
|
||||
|
||||
import jscl.JsclMathEngine;
|
||||
import jscl.util.ExpressionGenerator;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 12/14/11
|
||||
* Time: 10:40 PM
|
||||
*/
|
||||
public class RandomExpressionTest {
|
||||
|
||||
public static final int MAX = 1000;
|
||||
|
||||
@Test
|
||||
public void testRandomExpressions() throws Exception {
|
||||
final ExpressionGenerator eg = new ExpressionGenerator(20);
|
||||
int i = 0;
|
||||
while (i < MAX) {
|
||||
final String expression = eg.generate();
|
||||
final String result = JsclMathEngine.getInstance().evaluate(expression);
|
||||
|
||||
//System.out.println(result + "-(" + expression + ")");
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
118
jscl/src/test/java/jscl/math/TrigonometricTest.java
Normal file
118
jscl/src/test/java/jscl/math/TrigonometricTest.java
Normal file
@@ -0,0 +1,118 @@
|
||||
package jscl.math;
|
||||
|
||||
import au.com.bytecode.opencsv.CSVReader;
|
||||
import jscl.AngleUnit;
|
||||
import jscl.JsclMathEngine;
|
||||
import jscl.MathEngine;
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 11/22/11
|
||||
* Time: 12:49 PM
|
||||
*/
|
||||
public class TrigonometricTest {
|
||||
|
||||
// todo serso: due to conversion errors values on the borders are calculated not precisely
|
||||
/*
|
||||
0;0;1;0;Infinity
|
||||
90;1;0;1.633123935319537E16;0
|
||||
180;0;-1;0;-8.165619676597685E15
|
||||
270;-1;0;5.443746451065123E15;0
|
||||
360;0;1;0;-4.0828098382988425E15
|
||||
*/
|
||||
|
||||
@Test
|
||||
public void testValues() throws Exception {
|
||||
CSVReader reader = null;
|
||||
try {
|
||||
final MathEngine me = JsclMathEngine.getInstance();
|
||||
|
||||
reader = new CSVReader(new InputStreamReader(TrigonometricTest.class.getResourceAsStream("/jscl/math/trig_table.csv")), '\t');
|
||||
|
||||
// skip first line
|
||||
reader.readNext();
|
||||
|
||||
String[] line = reader.readNext();
|
||||
for (; line != null; line = reader.readNext()) {
|
||||
final Integer degrees = Integer.valueOf(line[0]);
|
||||
|
||||
final Double sinValue = Double.valueOf(line[1]);
|
||||
final Double cosValue = Double.valueOf(line[2]);
|
||||
final Double tgValue = Double.valueOf(line[3]);
|
||||
final Double ctgValue = Double.valueOf(line[4]);
|
||||
|
||||
final Double radians = Double.valueOf(line[5]);
|
||||
|
||||
final Double sinhValue = Double.valueOf(line[6]);
|
||||
final Double coshValue = Double.valueOf(line[7]);
|
||||
final Double tghValue = Double.valueOf(line[8]);
|
||||
final Double cthgValue = Double.valueOf(line[9]);
|
||||
|
||||
final Double asinValue = Double.valueOf(line[10]);
|
||||
final Double acosValue = Double.valueOf(line[11]);
|
||||
final Double atanValue = Double.valueOf(line[12]);
|
||||
|
||||
|
||||
testValue(sinValue, Double.valueOf(me.evaluate("sin(" + degrees + "°)")), degrees);
|
||||
testValue(cosValue, Double.valueOf(me.evaluate("cos(" + degrees + "°)")), degrees);
|
||||
testValue(tgValue, Double.valueOf(me.evaluate("tan(" + degrees + "°)")), degrees);
|
||||
testValue(ctgValue, Double.valueOf(me.evaluate("cot(" + degrees + "°)")), degrees);
|
||||
|
||||
testValue(sinhValue, Double.valueOf(me.evaluate("sinh(" + degrees + "°)")), degrees);
|
||||
testValue(coshValue, Double.valueOf(me.evaluate("cosh(" + degrees + "°)")), degrees);
|
||||
testValue(tghValue, Double.valueOf(me.evaluate("tanh(" + degrees + "°)")), degrees);
|
||||
testValue(cthgValue, Double.valueOf(me.evaluate("coth(" + degrees + "°)")), degrees);
|
||||
|
||||
final AngleUnit angleUnits = me.getAngleUnits();
|
||||
try {
|
||||
me.setAngleUnits(AngleUnit.rad);
|
||||
|
||||
testValue(sinValue, Double.valueOf(me.evaluate("sin(" + radians + ")")), degrees);
|
||||
testValue(cosValue, Double.valueOf(me.evaluate("cos(" + radians + ")")), degrees);
|
||||
testValue(tgValue, Double.valueOf(me.evaluate("tan(" + radians + ")")), degrees);
|
||||
testValue(ctgValue, Double.valueOf(me.evaluate("cot(" + radians + ")")), degrees);
|
||||
|
||||
testValue(sinhValue, Double.valueOf(me.evaluate("sinh(" + radians + ")")), degrees);
|
||||
testValue(coshValue, Double.valueOf(me.evaluate("cosh(" + radians + ")")), degrees);
|
||||
testValue(tghValue, Double.valueOf(me.evaluate("tanh(" + radians + ")")), degrees);
|
||||
testValue(cthgValue, Double.valueOf(me.evaluate("coth(" + radians + ")")), degrees);
|
||||
} finally {
|
||||
me.setAngleUnits(angleUnits);
|
||||
}
|
||||
|
||||
testValue(asinValue, Double.valueOf(me.evaluate("rad(asin(" + sinValue + "))")), degrees);
|
||||
testValue(acosValue, Double.valueOf(me.evaluate("rad(acos(" + cosValue + "))")), degrees);
|
||||
testValue(atanValue, Double.valueOf(me.evaluate("rad(atan(" + tgValue + "))")), degrees);
|
||||
|
||||
// todo serso: check this
|
||||
//testValue((double)degrees, Double.valueOf(me.evaluate("asin(sin(" + degrees + "°))")), degrees);
|
||||
//testValue((double)degrees, Double.valueOf(me.evaluate("acos(cos(" + degrees + "°))")), degrees);
|
||||
//testValue((double)degrees, Double.valueOf(me.evaluate("atan(tan(" + degrees + "°))")), degrees);
|
||||
//testValue((double)degrees, Double.valueOf(me.evaluate("acot(cot(" + degrees + "°))")), degrees);
|
||||
|
||||
testValue(sinValue, Double.valueOf(me.evaluate("sin(asin(sin(" + degrees + "°)))")), degrees);
|
||||
testValue(cosValue, Double.valueOf(me.evaluate("cos(acos(cos(" + degrees + "°)))")), degrees);
|
||||
testValue(tgValue, Double.valueOf(me.evaluate("tan(atan(tan(" + degrees + "°)))")), degrees);
|
||||
testValue(ctgValue, Double.valueOf(me.evaluate("cot(acot(cot(" + degrees + "°)))")), degrees);
|
||||
}
|
||||
} finally {
|
||||
if (reader != null) {
|
||||
reader.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void testValue(Double expected, Double actual, Integer degrees) {
|
||||
if (expected.isInfinite() && actual.isInfinite()) {
|
||||
// ok
|
||||
} else if (expected.isNaN() && actual.isNaN()) {
|
||||
// ok
|
||||
} else {
|
||||
Assert.assertTrue("Actual: " + actual + ", expected: " + expected + " for " + degrees + "°", Math.abs(expected - actual) < Math.pow(10, -10));
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,32 @@
|
||||
package jscl.math.function;
|
||||
|
||||
import org.solovyev.common.JBuilder;
|
||||
import org.solovyev.common.math.AbstractMathRegistry;
|
||||
import org.solovyev.common.math.AbstractMathRegistryTest;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 6/15/13
|
||||
* Time: 9:23 PM
|
||||
*/
|
||||
public class ConstantsRegistryTest extends AbstractMathRegistryTest<IConstant> {
|
||||
|
||||
@Override
|
||||
protected JBuilder<? extends IConstant> createBuilder(@Nonnull final String name) {
|
||||
return new JBuilder<IConstant>() {
|
||||
@Nonnull
|
||||
@Override
|
||||
public IConstant create() {
|
||||
return new ExtendedConstant(new Constant(name), name, name);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
protected AbstractMathRegistry<IConstant> getRegistry() {
|
||||
return new ConstantsRegistry();
|
||||
}
|
||||
}
|
171
jscl/src/test/java/jscl/math/function/CustomFunctionTest.java
Normal file
171
jscl/src/test/java/jscl/math/function/CustomFunctionTest.java
Normal file
@@ -0,0 +1,171 @@
|
||||
package jscl.math.function;
|
||||
|
||||
import jscl.AngleUnit;
|
||||
import jscl.JsclMathEngine;
|
||||
import jscl.math.Expression;
|
||||
import jscl.text.ParseException;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 11/15/11
|
||||
* Time: 5:35 PM
|
||||
*/
|
||||
public class CustomFunctionTest {
|
||||
|
||||
@Test
|
||||
public void testLog() throws Exception {
|
||||
JsclMathEngine mathEngine = JsclMathEngine.getInstance();
|
||||
|
||||
Assert.assertEquals("∞", Expression.valueOf("1/0").numeric().toString());
|
||||
Assert.assertEquals("∞", Expression.valueOf("ln(10)/ln(1)").numeric().toString());
|
||||
|
||||
// logarithm
|
||||
Function function = mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder(true, "log", Arrays.asList("a", "b"), "ln(b)/ln(a)"));
|
||||
Assert.assertEquals("log(a, b)", function.toString());
|
||||
Assert.assertEquals("ln(b)/ln(a)", ((CustomFunction) mathEngine.getFunctionsRegistry().get("log")).getContent());
|
||||
Assert.assertEquals("∞", Expression.valueOf("log(1, 10)").numeric().toString());
|
||||
Assert.assertEquals("3.3219280948873626", Expression.valueOf("log(2, 10)").numeric().toString());
|
||||
Assert.assertEquals("1.4306765580733933", Expression.valueOf("log(5, 10)").numeric().toString());
|
||||
Assert.assertEquals("0.9602525677891275", Expression.valueOf("log(11, 10)").numeric().toString());
|
||||
Assert.assertEquals("1/b*1/ln(a)", Expression.valueOf("∂(log(a, b), b)").expand().toString());
|
||||
Assert.assertEquals("-1/a*(1/ln(a))^2*ln(b)", Expression.valueOf("∂(log(a, b), a)").expand().toString());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDerivative() throws Exception {
|
||||
JsclMathEngine mathEngine = JsclMathEngine.getInstance();
|
||||
|
||||
mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder("t1", Arrays.asList("a"), "sin(a)"));
|
||||
Assert.assertEquals("1", Expression.valueOf("t1(90)").numeric().toString());
|
||||
Assert.assertEquals("cos(t)", Expression.valueOf("∂(t1(t), t)").expand().toString());
|
||||
Assert.assertEquals("0", Expression.valueOf("∂(t1(t), t2)").expand().toString());
|
||||
Assert.assertEquals("cos(a)", Expression.valueOf("∂(t1(a), a)").expand().toString());
|
||||
Assert.assertEquals("1", Expression.valueOf("∂(t1(a), t1(a))").expand().toString());
|
||||
mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder("t2", Arrays.asList("a", "b"), "b*sin(a)"));
|
||||
Assert.assertEquals("y*cos(x)", Expression.valueOf("∂(t2(x, y), x)").expand().toString());
|
||||
Assert.assertEquals("sin(x)", Expression.valueOf("∂(t2(x, y), y)").expand().toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAntiDerivative() throws Exception {
|
||||
JsclMathEngine mathEngine = JsclMathEngine.getInstance();
|
||||
|
||||
mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder("t1", Arrays.asList("a"), "sin(a)"));
|
||||
Assert.assertEquals("1", Expression.valueOf("t1(90)").numeric().toString());
|
||||
|
||||
|
||||
try {
|
||||
mathEngine.setAngleUnits(AngleUnit.rad);
|
||||
Assert.assertEquals("-cos(t)", Expression.valueOf("∫(t1(t), t)").expand().toString());
|
||||
Assert.assertEquals("t2*sin(t)", Expression.valueOf("∫(t1(t), t2)").expand().toString());
|
||||
Assert.assertEquals("-cos(a)", Expression.valueOf("∫(t1(a), a)").expand().toString());
|
||||
Assert.assertEquals("1/2*sin(a)^2", Expression.valueOf("∫(t1(a), t1(a))").expand().toString());
|
||||
mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder("t2", Arrays.asList("a", "b"), "b*sin(a)"));
|
||||
Assert.assertEquals("-y*cos(x)", Expression.valueOf("∫(t2(x, y), x)").expand().toString());
|
||||
Assert.assertEquals("1/2*y^2*sin(x)", Expression.valueOf("∫(t2(x, y), y)").expand().toString());
|
||||
} finally {
|
||||
mathEngine.setAngleUnits(AngleUnit.deg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testFunction() throws Exception {
|
||||
JsclMathEngine mathEngine = JsclMathEngine.getInstance();
|
||||
|
||||
mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder("testFunction", Arrays.asList("a", "b", "c", "d"), "b*cos(a)/c+d"));
|
||||
Assert.assertEquals("6.749543120264322", Expression.valueOf("testFunction(2, 3, 4, 6)").numeric().toString());
|
||||
Assert.assertEquals("7.749543120264322", Expression.valueOf("testFunction(2, 3, 4, 7)").numeric().toString());
|
||||
Assert.assertEquals("6.749543120264322", Expression.valueOf("testFunction(2*1, 3, 4, 6)").numeric().toString());
|
||||
Assert.assertEquals("6.749543120264322", Expression.valueOf("testFunction(2*1, 3, 4, 3!)").numeric().toString());
|
||||
Assert.assertEquals("6.749543120264322", Expression.valueOf("testFunction(2*1, 3, 2^2-1+e^0, 3!)").numeric().toString());
|
||||
Assert.assertEquals("testFunction(2, 3, 4, 3!)", Expression.valueOf("testFunction(2*1, 3, 2^2-1+e^0, 3!)").simplify().toString());
|
||||
Assert.assertEquals("3*cos(2)/4+3!", Expression.valueOf("testFunction(2*1, 3, 2^2-1+e^0, 3!)").expand().toString());
|
||||
Assert.assertEquals("3*(1/2*1/exp(2*i)+1/2*exp(2*i))/4+3!", Expression.valueOf("testFunction(2*1, 3, 2^2-1+e^0, 3!)").elementary().toString());
|
||||
Assert.assertEquals("sin(t)^2*testFunction(2, 3, 4, 3!)", Expression.valueOf("sin(t)*testFunction(2*1, 3, 2^2-1+e^0, 3!)*sin(t)").simplify().toString());
|
||||
Assert.assertEquals("testFunction(2, 3, 4, 3!)^2", Expression.valueOf("testFunction(2*1, 3, 2^2-1+e^0, 3!)*testFunction(2, 3, 4, 3!)").simplify().toString());
|
||||
try {
|
||||
Expression.valueOf("testFunction(2*1, 3, 2^2-1+e^0, 3!)*testFunction(2, 3, 4)");
|
||||
Assert.fail();
|
||||
} catch (ParseException e) {
|
||||
// ok, not enough parameters
|
||||
}
|
||||
|
||||
mathEngine.getConstantsRegistry().add(new ExtendedConstant.Builder(new Constant("a"), 1000d));
|
||||
mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder("testFunction2", Arrays.asList("a", "b", "c", "d"), "b*cos(a)/c+d"));
|
||||
Assert.assertEquals("6.749543120264322", Expression.valueOf("testFunction2(2, 3, 4, 6)").numeric().toString());
|
||||
Assert.assertEquals("7.749543120264322", Expression.valueOf("testFunction2(2, 3, 4, 7)").numeric().toString());
|
||||
Assert.assertEquals("6.749543120264322", Expression.valueOf("testFunction2(2*1, 3, 4, 6)").numeric().toString());
|
||||
Assert.assertEquals("6.749543120264322", Expression.valueOf("testFunction2(2*1, 3, 2^2-1+e^0, 3!)").numeric().toString());
|
||||
|
||||
mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder("testFunction3", Arrays.asList("a", "b", "c", "d"), "testFunction2(a, b, c, d) - testFunction(a, b, c, d)"));
|
||||
Assert.assertEquals("0", Expression.valueOf("testFunction3(2, 3, 4, 6)").numeric().toString());
|
||||
Assert.assertEquals("0", Expression.valueOf("testFunction3(2, 3, 4, 7)").numeric().toString());
|
||||
Assert.assertEquals("0", Expression.valueOf("testFunction3(2*1, 3, 4, 6)").numeric().toString());
|
||||
Assert.assertEquals("0", Expression.valueOf("testFunction3(2*1, 3, 2^2-1+e^0, 3!)").numeric().toString());
|
||||
|
||||
mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder("testFunction4", Arrays.asList("a", "b", "c", "d"), "testFunction2(a, b/2, c/3, d/4) - testFunction(a, b!, c, d)"));
|
||||
Assert.assertEquals("-4.874771560132161", Expression.valueOf("testFunction4(2, 3, 4, 6)").numeric().toString());
|
||||
Assert.assertEquals("-5.624771560132161", Expression.valueOf("testFunction4(2, 3, 4, 7)").numeric().toString());
|
||||
Assert.assertEquals("-4.874771560132161", Expression.valueOf("testFunction4(2*1, 3, 4, 6)").numeric().toString());
|
||||
Assert.assertEquals("-4.874771560132161", Expression.valueOf("testFunction4(2*1, 3, 2^2-1+e^0, 3!)").numeric().toString());
|
||||
|
||||
mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder("testFunction5", Arrays.asList("a", "b"), "testFunction2(a, b/2, 2, 1) - testFunction(a, b!, 4!, 1)"));
|
||||
Assert.assertEquals("0.4996954135095478", Expression.valueOf("testFunction5(2, 3)").numeric().toString());
|
||||
Assert.assertEquals("0.4996954135095478", Expression.valueOf("testFunction5(2, 3)").numeric().toString());
|
||||
Assert.assertEquals("0.4996954135095478", Expression.valueOf("testFunction5(2*1, 3)").numeric().toString());
|
||||
Assert.assertEquals("-111.02230246251565E-18", Expression.valueOf("testFunction5(2*1, 2^2-1+e^0)").numeric().toString());
|
||||
|
||||
try {
|
||||
Expression.valueOf("testFunction5(2, 3.5)").numeric();
|
||||
Assert.fail();
|
||||
} catch (ArithmeticException e) {
|
||||
|
||||
}
|
||||
|
||||
mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder("testFunction6", Arrays.asList("a", "b"), "testFunction(a, b!, 4!, Π)"));
|
||||
Assert.assertEquals("180.24984770675476", Expression.valueOf("testFunction6(2, 3)").numeric().toString());
|
||||
|
||||
mathEngine.getConstantsRegistry().add(new ExtendedConstant.Builder(new Constant("e"), 181d));
|
||||
mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder("testFunction7", Arrays.asList("a", "b"), "testFunction(a, b!, 4!, e)"));
|
||||
Assert.assertEquals("181.24984770675476", Expression.valueOf("testFunction7(2, 3)").numeric().toString());
|
||||
|
||||
mathEngine.getConstantsRegistry().add(new ExtendedConstant.Builder(new Constant("e"), 181d));
|
||||
mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder("testFunction8", Arrays.asList("a", "b"), "testFunction(sin(a), b!, 4!, e)"));
|
||||
Assert.assertEquals("181.24999995362296", Expression.valueOf("testFunction8(2, 3)").numeric().toString());
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFunction2() throws Exception {
|
||||
JsclMathEngine mathEngine = JsclMathEngine.getInstance();
|
||||
|
||||
mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder("f", Arrays.asList("x", "y"), "z1/z2*√(x^2+y^2)"));
|
||||
mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder("f2", Arrays.asList("x", "y"), "√(x^2+y^2)"));
|
||||
mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder("f3", Arrays.asList("x", "y"), "x^2+y^2"));
|
||||
|
||||
try {
|
||||
Assert.assertEquals("1", Expression.valueOf("f(1, 1)").numeric().toString());
|
||||
Assert.fail();
|
||||
} catch (ArithmeticException e) {
|
||||
//ok
|
||||
}
|
||||
|
||||
Assert.assertEquals("1.4142135623730951", Expression.valueOf("f2(1, 1)").numeric().toString());
|
||||
Assert.assertEquals("5", Expression.valueOf("f2(4, 3)").numeric().toString());
|
||||
|
||||
Assert.assertEquals("2*z1", Expression.valueOf("∂(f3(z1, z2), z1)").expand().toString());
|
||||
Assert.assertEquals("2*z2", Expression.valueOf("∂(f3(z1, z2), z2)").expand().toString());
|
||||
|
||||
// test symbols
|
||||
mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder("f4", Arrays.asList("x", "y"), "2 000*x^2+y^2"));
|
||||
mathEngine.getFunctionsRegistry().add(new CustomFunction.Builder("f5", Arrays.asList("x", "y"), "2'000* x ^2+y^2\r"));
|
||||
|
||||
|
||||
}
|
||||
}
|
33
jscl/src/test/java/jscl/math/function/DegTest.java
Normal file
33
jscl/src/test/java/jscl/math/function/DegTest.java
Normal file
@@ -0,0 +1,33 @@
|
||||
package jscl.math.function;
|
||||
|
||||
import jscl.JsclMathEngine;
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
import org.solovyev.common.math.Maths;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 11/12/11
|
||||
* Time: 4:17 PM
|
||||
*/
|
||||
public class DegTest {
|
||||
|
||||
@Test
|
||||
public void testDeg() throws Exception {
|
||||
final JsclMathEngine mathEngine = JsclMathEngine.getInstance();
|
||||
|
||||
Assert.assertEquals("2", mathEngine.evaluate("deg(0.03490658503988659)"));
|
||||
Assert.assertEquals("-2", mathEngine.evaluate("deg(-0.03490658503988659)"));
|
||||
Assert.assertEquals("180", mathEngine.evaluate("deg(" + String.valueOf(Math.PI) + ")"));
|
||||
|
||||
for (int i = 0; i < 1000; i++) {
|
||||
double value = Math.random() * 100000;
|
||||
assertEquals(value, Double.valueOf(mathEngine.evaluate("rad(deg(" + value + "))")));
|
||||
assertEquals(value, Double.valueOf(mathEngine.evaluate("deg(rad(" + value + "))")));
|
||||
}
|
||||
}
|
||||
|
||||
private void assertEquals(double expected, Double actual) {
|
||||
Assert.assertTrue("Expected=" + expected + ", actual=" + actual, Maths.equals(expected, actual, 8));
|
||||
}
|
||||
}
|
20
jscl/src/test/java/jscl/math/function/DmsTest.java
Normal file
20
jscl/src/test/java/jscl/math/function/DmsTest.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package jscl.math.function;
|
||||
|
||||
import jscl.JsclMathEngine;
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 11/14/11
|
||||
* Time: 1:46 PM
|
||||
*/
|
||||
public class DmsTest {
|
||||
@Test
|
||||
public void testFunction() throws Exception {
|
||||
final JsclMathEngine mathEngine = JsclMathEngine.getInstance();
|
||||
|
||||
Assert.assertEquals("43.1025", mathEngine.evaluate("dms(43,6,9)"));
|
||||
Assert.assertEquals("102.765", mathEngine.evaluate("dms(102, 45, 54)"));
|
||||
}
|
||||
}
|
25
jscl/src/test/java/jscl/math/function/FunctionTest.java
Normal file
25
jscl/src/test/java/jscl/math/function/FunctionTest.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package jscl.math.function;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 10/29/11
|
||||
* Time: 5:20 PM
|
||||
*/
|
||||
public class FunctionTest {
|
||||
|
||||
@Test
|
||||
public void testSubstituteParameter() throws Exception {
|
||||
/* Ln ln = new Ln(null);
|
||||
Assert.assertEquals("ln(x)", ln.toString());
|
||||
Root eq = new Root(null, null);
|
||||
Assert.assertEquals("eq(x, y)", eq.toString());
|
||||
Generic[] parameter = new Generic[40];
|
||||
for(int i = 0; i < 40; i++) {
|
||||
parameter[i] = null;
|
||||
}
|
||||
eq.setParameters(parameter);
|
||||
Assert.assertEquals("root(x, y, z, a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, a, b, c, d, e, f, g, h, i, j, k)", eq.toString());*/
|
||||
}
|
||||
}
|
@@ -0,0 +1,23 @@
|
||||
package jscl.math.function;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 11/12/11
|
||||
* Time: 2:14 PM
|
||||
*/
|
||||
public class FunctionsRegistryTest {
|
||||
|
||||
@Test
|
||||
public void testOrder() throws Exception {
|
||||
Function prev = null;
|
||||
for (Function function : FunctionsRegistry.getInstance().getEntities()) {
|
||||
if (prev != null) {
|
||||
Assert.assertTrue(prev.getName() + "<" + function.getName(), prev.getName().length() >= function.getName().length());
|
||||
}
|
||||
prev = function;
|
||||
}
|
||||
}
|
||||
}
|
20
jscl/src/test/java/jscl/math/function/LgTest.java
Normal file
20
jscl/src/test/java/jscl/math/function/LgTest.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package jscl.math.function;
|
||||
|
||||
import jscl.math.Expression;
|
||||
import org.junit.Test;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 6/15/13
|
||||
* Time: 12:52 AM
|
||||
*/
|
||||
public class LgTest {
|
||||
|
||||
@Test
|
||||
public void testSimplify() throws Exception {
|
||||
assertEquals("lg(3)+lg(x/b)", Expression.valueOf("lg(3*x/b)").simplify().toString());
|
||||
assertEquals("-lg(7)+lg(15)", Expression.valueOf("lg(3*5/7)").simplify().toString());
|
||||
}
|
||||
}
|
39
jscl/src/test/java/jscl/math/function/LnTest.java
Normal file
39
jscl/src/test/java/jscl/math/function/LnTest.java
Normal file
@@ -0,0 +1,39 @@
|
||||
package jscl.math.function;
|
||||
|
||||
import jscl.JsclMathEngine;
|
||||
import jscl.MathEngine;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 1/9/12
|
||||
* Time: 6:49 PM
|
||||
*/
|
||||
public class LnTest {
|
||||
|
||||
@Test
|
||||
public void testConjugate() throws Exception {
|
||||
final MathEngine me = JsclMathEngine.getInstance();
|
||||
|
||||
assertEquals("ln(5-i)", me.simplify("conjugate(ln(5+√(-1)))"));
|
||||
assertEquals("lg(5-i)", me.simplify("conjugate(lg(5+√(-1)))"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAntiDerivative() throws Exception {
|
||||
final MathEngine me = JsclMathEngine.getInstance();
|
||||
|
||||
assertEquals("-x+x*ln(x)", me.simplify("∫(ln(x), x)"));
|
||||
assertEquals("-(x-x*ln(x))/(ln(2)+ln(5))", me.simplify("∫(lg(x), x)"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDerivative() throws Exception {
|
||||
final MathEngine me = JsclMathEngine.getInstance();
|
||||
|
||||
assertEquals("1/x", me.simplify("∂(ln(x), x)"));
|
||||
assertEquals("1/(x*ln(2)+x*ln(5))", me.simplify("∂(lg(x), x)"));
|
||||
}
|
||||
}
|
29
jscl/src/test/java/jscl/math/function/PowTest.java
Normal file
29
jscl/src/test/java/jscl/math/function/PowTest.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package jscl.math.function;
|
||||
|
||||
import jscl.JsclMathEngine;
|
||||
import jscl.math.Expression;
|
||||
import jscl.math.JsclInteger;
|
||||
import org.junit.Test;
|
||||
|
||||
import static junit.framework.Assert.fail;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 6/15/13
|
||||
* Time: 10:13 PM
|
||||
*/
|
||||
public class PowTest {
|
||||
|
||||
@Test
|
||||
public void testPow() throws Exception {
|
||||
JsclMathEngine me = JsclMathEngine.getInstance();
|
||||
|
||||
new Pow(Expression.valueOf("10"), new Inverse(JsclInteger.valueOf(10l)).expressionValue()).rootValue();
|
||||
try {
|
||||
new Pow(Expression.valueOf("10"), new Inverse(JsclInteger.valueOf(10000000000l)).expressionValue()).rootValue();
|
||||
fail();
|
||||
} catch (NotRootException e) {
|
||||
// ok
|
||||
}
|
||||
}
|
||||
}
|
34
jscl/src/test/java/jscl/math/function/RadTest.java
Normal file
34
jscl/src/test/java/jscl/math/function/RadTest.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package jscl.math.function;
|
||||
|
||||
import jscl.JsclMathEngine;
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 11/12/11
|
||||
* Time: 4:00 PM
|
||||
*/
|
||||
public class RadTest {
|
||||
@Test
|
||||
public void testRad() throws Exception {
|
||||
final JsclMathEngine mathEngine = JsclMathEngine.getInstance();
|
||||
|
||||
Assert.assertEquals("0.03490658503988659", mathEngine.evaluate("rad(2)"));
|
||||
Assert.assertEquals("0.03490658503988659", mathEngine.evaluate("rad(1+1)"));
|
||||
Assert.assertEquals("-0.03490658503988659", mathEngine.evaluate("rad(-2)"));
|
||||
Assert.assertEquals("-0.03490658503988659", mathEngine.evaluate("rad(-1-1)"));
|
||||
Assert.assertEquals("π", mathEngine.evaluate("rad(180)"));
|
||||
Assert.assertEquals(String.valueOf(-Math.PI), mathEngine.evaluate("rad(-180)"));
|
||||
|
||||
// todo serso: think about zeroes
|
||||
Assert.assertEquals("rad(-180, 0, 0)", mathEngine.simplify("rad(-180)"));
|
||||
Assert.assertEquals("rad(2, 0, 0)", mathEngine.simplify("rad(1+1)"));
|
||||
|
||||
Assert.assertEquals("rad(-180, 0, 0)", mathEngine.elementary("rad(-180)"));
|
||||
Assert.assertEquals("rad(2, 0, 0)", mathEngine.elementary("rad(1+1)"));
|
||||
|
||||
Assert.assertEquals(mathEngine.evaluate("rad(43.1025)"), mathEngine.evaluate("rad(43,6,9)"));
|
||||
Assert.assertEquals(mathEngine.evaluate("rad(102.765)"), mathEngine.evaluate("rad(102, 45, 54)"));
|
||||
}
|
||||
}
|
25
jscl/src/test/java/jscl/math/function/SgnTest.java
Normal file
25
jscl/src/test/java/jscl/math/function/SgnTest.java
Normal file
@@ -0,0 +1,25 @@
|
||||
package jscl.math.function;
|
||||
|
||||
import jscl.JsclMathEngine;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 2/10/12
|
||||
* Time: 9:35 PM
|
||||
*/
|
||||
public class SgnTest {
|
||||
|
||||
@Test
|
||||
public void testSgn() throws Exception {
|
||||
final JsclMathEngine me = JsclMathEngine.getInstance();
|
||||
|
||||
Assert.assertEquals("1", me.evaluate("sgn(10)"));
|
||||
Assert.assertEquals("1", me.evaluate("sgn(0.5)"));
|
||||
Assert.assertEquals("0", me.evaluate("sgn(0)"));
|
||||
Assert.assertEquals("0", me.evaluate("sgn(-0)"));
|
||||
Assert.assertEquals("-1", me.evaluate("sgn(-1)"));
|
||||
Assert.assertEquals("-1", me.evaluate("sgn(-10)"));
|
||||
}
|
||||
}
|
31
jscl/src/test/java/jscl/math/function/SqrtTest.java
Normal file
31
jscl/src/test/java/jscl/math/function/SqrtTest.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package jscl.math.function;
|
||||
|
||||
import jscl.AngleUnit;
|
||||
import jscl.JsclMathEngine;
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 5/14/12
|
||||
* Time: 1:15 PM
|
||||
*/
|
||||
public class SqrtTest {
|
||||
|
||||
@Test
|
||||
public void testNumeric() throws Exception {
|
||||
final JsclMathEngine me = JsclMathEngine.getInstance();
|
||||
final AngleUnit defaultAngleUnits = me.getAngleUnits();
|
||||
|
||||
Assert.assertEquals("0.9999060498015505+0.013707354604707477*i", me.evaluate("√(√(-1))"));
|
||||
Assert.assertEquals("0.9984971498638638+0.05480366514878954*i", me.evaluate("√(√(-1))^4"));
|
||||
|
||||
try {
|
||||
me.setAngleUnits(AngleUnit.rad);
|
||||
Assert.assertEquals("0.7071067811865476+0.7071067811865475*i", me.evaluate("√(√(-1))"));
|
||||
Assert.assertEquals("-1+277.55575615628914E-18*i", me.evaluate("√(√(-1))^4"));
|
||||
} finally {
|
||||
me.setAngleUnits(defaultAngleUnits);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,27 @@
|
||||
package jscl.math.function.trigonometric;
|
||||
|
||||
import jscl.JsclMathEngine;
|
||||
import jscl.math.function.Constant;
|
||||
import jscl.math.function.ExtendedConstant;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 6/17/13
|
||||
* Time: 10:36 PM
|
||||
*/
|
||||
public class CosTest {
|
||||
|
||||
@Test
|
||||
public void testIntegral() throws Exception {
|
||||
final JsclMathEngine me = JsclMathEngine.getInstance();
|
||||
me.getConstantsRegistry().add(new ExtendedConstant.Builder(new Constant("t"), 10d));
|
||||
Assert.assertEquals("-sin(t)", me.simplify("∂(cos(t),t,t,1)"));
|
||||
Assert.assertEquals("∂(cos(t), t, t, 1°)", me.simplify("∂(cos(t),t,t,1°)"));
|
||||
Assert.assertEquals("-0.17364817766693033", me.evaluate("∂(cos(t),t,t,1)"));
|
||||
Assert.assertEquals("∂(cos(t), t, t, 1°)", me.evaluate("∂(cos(t),t,t,1°)"));
|
||||
Assert.assertEquals("-0.17364817766693033", me.evaluate("∂(cos(t),t,t,2-1)"));
|
||||
Assert.assertEquals("-0.17364817766693033", me.evaluate("∂(cos(t),t,t,2^5-31)"));
|
||||
}
|
||||
}
|
@@ -0,0 +1,46 @@
|
||||
package jscl.math.function.trigonometric;
|
||||
|
||||
import jscl.AngleUnit;
|
||||
import jscl.JsclMathEngine;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 1/7/12
|
||||
* Time: 3:51 PM
|
||||
*/
|
||||
public class SinTest {
|
||||
|
||||
@Test
|
||||
public void testIntegrate() throws Exception {
|
||||
final JsclMathEngine me = JsclMathEngine.getInstance();
|
||||
|
||||
// todo serso: uncomment after variable modification issue fixed
|
||||
/*Assert.assertEquals("-cos(x)", me.simplify("∫(sin(x), x)"));
|
||||
Assert.assertEquals("-cos(x*π)/π", me.simplify("∫(sin(π*x), x)"));
|
||||
|
||||
Assert.assertEquals("1.0", me.evaluate("cos(0)"));
|
||||
Assert.assertEquals("0.8660254037844387", me.evaluate("cos(30)"));
|
||||
Assert.assertEquals("0.1339745962155613", me.evaluate("∫ab(sin(x), x, 0, 30)"));*/
|
||||
|
||||
try {
|
||||
me.setAngleUnits(AngleUnit.rad);
|
||||
Assert.assertEquals("0.5403023058681398", me.evaluate("cos(1)"));
|
||||
Assert.assertEquals("0.3623577544766736", me.evaluate("cos(1.2)"));
|
||||
Assert.assertEquals("0.17794455139146614", me.evaluate("∫ab(sin(x), x, 1, 1.2)"));
|
||||
} finally {
|
||||
me.setAngleUnits(AngleUnit.deg);
|
||||
}
|
||||
|
||||
|
||||
//Assert.assertEquals("7.676178925", me.evaluate("∫ab(sin(x), x, 0, 30°)"));
|
||||
|
||||
try {
|
||||
me.setAngleUnits(AngleUnit.rad);
|
||||
Assert.assertEquals("0.1339745962155613", me.evaluate("∫ab(sin(x), x, 0, 30°)"));
|
||||
} finally {
|
||||
me.setAngleUnits(AngleUnit.deg);
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,58 @@
|
||||
package jscl.math.function.trigonometric;
|
||||
|
||||
import jscl.AngleUnit;
|
||||
import jscl.JsclMathEngine;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 1/7/12
|
||||
* Time: 4:03 PM
|
||||
*/
|
||||
public class TanTest {
|
||||
|
||||
@Test
|
||||
public void testIntegrate() throws Exception {
|
||||
final JsclMathEngine me = JsclMathEngine.getInstance();
|
||||
|
||||
// todo serso: uncomment after variable modification issue fixed
|
||||
/* Assert.assertEquals("-2*ln(2)-ln(cos(x))", me.simplify("∫(tan(x), x)"));
|
||||
Assert.assertEquals("-(2*ln(2)+ln(cos(x*π)))/π", me.simplify("∫(tan(π*x), x)"));
|
||||
|
||||
Assert.assertEquals("-0.015308831465985804", me.evaluate("ln(cos(10))"));
|
||||
Assert.assertEquals("-0.1438410362258904", me.evaluate("ln(cos(30))"));
|
||||
Assert.assertEquals("0.12853220475990468", me.evaluate("∫ab(tan(x), x, 10, 30)"));*/
|
||||
|
||||
try {
|
||||
me.setAngleUnits(AngleUnit.rad);
|
||||
assertEquals("-2*ln(2)-ln(cos(x))", me.simplify("∫(tan(x), x)"));
|
||||
assertEquals("-(2*ln(2)+ln(cos(x*π)))/π", me.simplify("∫(tan(π*x), x)"));
|
||||
assertEquals("-0.015308831465985804", me.evaluate("ln(cos(10*π/180))"));
|
||||
assertEquals("-0.1438410362258904", me.evaluate("ln(cos(30*π/180))"));
|
||||
assertEquals("0.12853220475990468", me.evaluate("∫ab(tan(x), x, 10*π/180, 30*π/180)"));
|
||||
} finally {
|
||||
me.setAngleUnits(AngleUnit.deg);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBoundaryConditions() throws Exception {
|
||||
final JsclMathEngine me = JsclMathEngine.getInstance();
|
||||
assertEquals("-∞", me.evaluate("tan(-450)"));
|
||||
assertEquals("0", me.evaluate("tan(-360)"));
|
||||
assertEquals("-∞", me.evaluate("tan(-270)"));
|
||||
assertEquals("0", me.evaluate("tan(-180)"));
|
||||
assertEquals("-∞", me.evaluate("tan(-90)"));
|
||||
assertEquals("0", me.evaluate("tan(0)"));
|
||||
assertEquals("∞", me.evaluate("tan(180/2)"));
|
||||
assertEquals("∞", me.evaluate("tan(45 + 45)"));
|
||||
assertEquals("∞", me.evaluate("tan(30*3)"));
|
||||
assertEquals("∞", me.evaluate("tan(90)"));
|
||||
assertEquals("0", me.evaluate("tan(180)"));
|
||||
assertEquals("∞", me.evaluate("tan(270)"));
|
||||
assertEquals("0", me.evaluate("tan(360)"));
|
||||
assertEquals("∞", me.evaluate("tan(450)"));
|
||||
}
|
||||
}
|
37
jscl/src/test/java/jscl/math/numeric/ComplexTest.java
Normal file
37
jscl/src/test/java/jscl/math/numeric/ComplexTest.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package jscl.math.numeric;
|
||||
|
||||
import jscl.AngleUnit;
|
||||
import jscl.JsclMathEngine;
|
||||
import jscl.math.Expression;
|
||||
import org.junit.Test;
|
||||
|
||||
import static junit.framework.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 5/14/12
|
||||
* Time: 2:24 PM
|
||||
*/
|
||||
public class ComplexTest {
|
||||
|
||||
@Test
|
||||
public void testSmallImag() throws Exception {
|
||||
assertEquals("1+100E-18*i", Complex.valueOf(1, 0.0000000000000001).toString());
|
||||
assertEquals("1-100E-18*i", Complex.valueOf(1, -0.0000000000000001).toString());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testTrig() throws Exception {
|
||||
try {
|
||||
JsclMathEngine.getInstance().setAngleUnits(AngleUnit.rad);
|
||||
assertEquals("1.543080634815244", Expression.valueOf("cos(i)").numeric().toString());
|
||||
assertEquals("1.1752011936438014*i", Expression.valueOf("sin(i)").numeric().toString());
|
||||
assertEquals("11013.232874703395*i", Expression.valueOf("sin(10*i)").numeric().toString());
|
||||
assertEquals("11013.232920103324", Expression.valueOf("cos(10*i)").numeric().toString());
|
||||
assertEquals("0.46211715726000974*i", Expression.valueOf("tan(i/2)").numeric().toString());
|
||||
assertEquals("-2.163953413738653*i", Expression.valueOf("cot(i/2)").numeric().toString());
|
||||
} finally {
|
||||
JsclMathEngine.getInstance().setAngleUnits(JsclMathEngine.DEFAULT_ANGLE_UNITS);
|
||||
}
|
||||
}
|
||||
}
|
16
jscl/src/test/java/jscl/math/numeric/MatrixTest.java
Normal file
16
jscl/src/test/java/jscl/math/numeric/MatrixTest.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package jscl.math.numeric;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 1/15/12
|
||||
* Time: 4:08 PM
|
||||
*/
|
||||
public class MatrixTest {
|
||||
|
||||
@Test
|
||||
public void testMatrix() throws Exception {
|
||||
//To change body of created methods use File | Settings | File Templates.
|
||||
}
|
||||
}
|
@@ -0,0 +1,63 @@
|
||||
package jscl.math.operator;
|
||||
|
||||
import jscl.JsclMathEngine;
|
||||
import jscl.MathEngine;
|
||||
import jscl.text.ParseException;
|
||||
import jscl.text.msg.Messages;
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 12/15/11
|
||||
* Time: 10:41 PM
|
||||
*/
|
||||
public class DoubleFactorialTest {
|
||||
|
||||
@Test
|
||||
public void testDoubleFactorial() throws Exception {
|
||||
final MathEngine me = JsclMathEngine.getInstance();
|
||||
|
||||
Assert.assertEquals("1", me.evaluate("0!"));
|
||||
Assert.assertEquals("1", me.evaluate("1!"));
|
||||
Assert.assertEquals("2", me.evaluate("2!"));
|
||||
Assert.assertEquals("6", me.evaluate("3!"));
|
||||
Assert.assertEquals("24", me.evaluate("4!"));
|
||||
|
||||
try {
|
||||
me.evaluate("(-1)!!");
|
||||
Assert.fail();
|
||||
} catch (ArithmeticException e) {
|
||||
// ok
|
||||
}
|
||||
|
||||
Assert.assertEquals("-1", me.evaluate("-1!!"));
|
||||
Assert.assertEquals("1", me.evaluate("0!!"));
|
||||
Assert.assertEquals("1", me.evaluate("1!!"));
|
||||
Assert.assertEquals("2", me.evaluate("2!!"));
|
||||
Assert.assertEquals("2", me.evaluate("(2!!)!"));
|
||||
Assert.assertEquals("2", me.evaluate("(2!)!!"));
|
||||
Assert.assertEquals("3", me.evaluate("3!!"));
|
||||
Assert.assertEquals("48", me.evaluate("(3!)!!"));
|
||||
Assert.assertEquals("6", me.evaluate("(3!!)!"));
|
||||
Assert.assertEquals("8", me.evaluate("4!!"));
|
||||
Assert.assertEquals("15", me.evaluate("5!!"));
|
||||
Assert.assertEquals("48", me.evaluate("6!!"));
|
||||
Assert.assertEquals("105", me.evaluate("7!!"));
|
||||
Assert.assertEquals("384", me.evaluate("8!!"));
|
||||
Assert.assertEquals("945", me.evaluate("9!!"));
|
||||
|
||||
try {
|
||||
me.evaluate("9!!!");
|
||||
Assert.fail();
|
||||
} catch (ParseException e) {
|
||||
if (Messages.msg_18.equals(e.getMessageCode())) {
|
||||
// ok
|
||||
} else {
|
||||
Assert.fail();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
26
jscl/src/test/java/jscl/math/operator/GcdTest.java
Normal file
26
jscl/src/test/java/jscl/math/operator/GcdTest.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package jscl.math.operator;
|
||||
|
||||
import jscl.JsclMathEngine;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 12/23/11
|
||||
* Time: 4:52 PM
|
||||
*/
|
||||
public class GcdTest {
|
||||
@Test
|
||||
public void testNumeric() throws Exception {
|
||||
JsclMathEngine mathEngine = JsclMathEngine.getInstance();
|
||||
|
||||
//mathEngine.getOperatorsRegistry().add(new Gcd());
|
||||
|
||||
|
||||
//Assert.assertEquals("1", Expression.valueOf("gcd(1, 1)").numeric().toString());
|
||||
//Assert.assertEquals("1", Expression.valueOf("gcd(2, 1)").numeric().toString());
|
||||
//Assert.assertEquals("2", Expression.valueOf("gcd(2, 4)").numeric().toString());
|
||||
//Assert.assertEquals("4", Expression.valueOf("gcd(4, 8)").numeric().toString());
|
||||
//Assert.assertEquals("4", Expression.valueOf("gcd(4.0, 8.0)").numeric().toString());
|
||||
//Assert.assertEquals("4", Expression.valueOf("gcd(8, 4)").numeric().toString());
|
||||
}
|
||||
}
|
@@ -0,0 +1,41 @@
|
||||
package jscl.math.operator;
|
||||
|
||||
import jscl.AngleUnit;
|
||||
import jscl.JsclMathEngine;
|
||||
import jscl.MathEngine;
|
||||
import jscl.math.Expression;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 1/14/12
|
||||
* Time: 1:06 PM
|
||||
*/
|
||||
public class IndefiniteIntegralTest {
|
||||
|
||||
@Test
|
||||
public void testIntegral() throws Exception {
|
||||
final MathEngine me = JsclMathEngine.getInstance();
|
||||
|
||||
try {
|
||||
Assert.assertEquals("∫(sin(t!), t)", me.evaluate("∫(sin(t!), t)"));
|
||||
Assert.fail();
|
||||
} catch (ArithmeticException e) {
|
||||
// ok
|
||||
}
|
||||
|
||||
try {
|
||||
me.setAngleUnits(AngleUnit.rad);
|
||||
Assert.assertEquals("-cos(t)", Expression.valueOf("∫(sin(t), t)").expand().toString());
|
||||
Assert.assertEquals("∫(sin(t!), t)", Expression.valueOf("∫(sin(t!), t)").expand().toString());
|
||||
Assert.assertEquals("∫(sin(t!), t)", me.simplify("∫(sin(t!), t)"));
|
||||
Assert.assertEquals("∫(sin(t°), t)", Expression.valueOf("∫(sin(t°), t)").expand().toString());
|
||||
Assert.assertEquals("∫(sin(t°), t)", me.simplify("∫(sin(t°), t)"));
|
||||
} finally {
|
||||
me.setAngleUnits(AngleUnit.deg);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
34
jscl/src/test/java/jscl/math/operator/MeanTest.java
Normal file
34
jscl/src/test/java/jscl/math/operator/MeanTest.java
Normal file
@@ -0,0 +1,34 @@
|
||||
package jscl.math.operator;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 12/26/11
|
||||
* Time: 11:15 AM
|
||||
*/
|
||||
public class MeanTest {
|
||||
|
||||
@Test
|
||||
public void testEvaluate() throws Exception {
|
||||
/*MathEngine me = JsclMathEngine.instance;
|
||||
try {
|
||||
me.evaluate("mean()");
|
||||
Assert.fail();
|
||||
} catch (ParseException e) {
|
||||
// ok
|
||||
}
|
||||
|
||||
Assert.assertEquals("0", me.evaluate("mean([0])"));
|
||||
Assert.assertEquals("5.0", me.evaluate("mean([10, 0])"));
|
||||
Assert.assertEquals("100+mean([10, 0]%)", me.evaluate("100 + mean([10, 0]%)"));
|
||||
Assert.assertEquals("105.0", me.evaluate("100 + mean([10, 0])"));
|
||||
Assert.assertEquals("105.0", me.evaluate("100 + mean([10, 0])%"));
|
||||
Assert.assertEquals("10", me.evaluate("mean([10])"));
|
||||
Assert.assertEquals("15.0", me.evaluate("mean([10, 20])"));
|
||||
Assert.assertEquals("0.5602494390798607", me.evaluate("mean([sin(7), cos(3)])"));
|
||||
Assert.assertEquals("0.5", me.evaluate("mean([1, 0])"));
|
||||
Assert.assertEquals("0.8", me.evaluate("mean([1, 0, 1, 1, 1])"));
|
||||
Assert.assertEquals("0.8", me.evaluate("mean([0.5+mean([1, 0]), 0, sin(90), 1, 1])"));*/
|
||||
}
|
||||
}
|
82
jscl/src/test/java/jscl/math/operator/PercentTest.java
Normal file
82
jscl/src/test/java/jscl/math/operator/PercentTest.java
Normal file
@@ -0,0 +1,82 @@
|
||||
package jscl.math.operator;
|
||||
|
||||
import jscl.JsclMathEngine;
|
||||
import jscl.text.ParseException;
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 11/14/11
|
||||
* Time: 2:10 PM
|
||||
*/
|
||||
public class PercentTest {
|
||||
|
||||
@Test
|
||||
public void testNumeric() throws Exception {
|
||||
final JsclMathEngine mathEngine = JsclMathEngine.getInstance();
|
||||
|
||||
Assert.assertEquals("150", mathEngine.evaluate("100+50%"));
|
||||
Assert.assertEquals("0", mathEngine.evaluate("100-100%"));
|
||||
Assert.assertEquals("50", mathEngine.evaluate("100*50%"));
|
||||
Assert.assertEquals("150", mathEngine.evaluate("100+100*50%"));
|
||||
Assert.assertEquals("125", mathEngine.evaluate("100+100*50%*50%"));
|
||||
Assert.assertEquals("125", mathEngine.evaluate("100+100*50%*(25+25)%"));
|
||||
Assert.assertEquals("250", mathEngine.evaluate("100+100*50%*(25+25)%+100%"));
|
||||
Assert.assertEquals("150", mathEngine.evaluate("100+(100*50%*(25+25)%+100%)"));
|
||||
Assert.assertEquals("140", mathEngine.evaluate("100+(20+20)%"));
|
||||
// todo serso: think about such behaviour
|
||||
Assert.assertEquals("124", mathEngine.evaluate("100+(20%+20%)"));
|
||||
|
||||
Assert.assertEquals("100+50%-50%", mathEngine.simplify("100+50%-50%"));
|
||||
|
||||
Assert.assertEquals("100+(100*50%*(50)%+100%)", mathEngine.simplify("100+(100*50%*(25+25)%+100%)"));
|
||||
|
||||
|
||||
Assert.assertEquals("450", mathEngine.evaluate("((100+100*50%)+50%)*200%"));
|
||||
Assert.assertEquals("150", mathEngine.evaluate("((100+100*50%)*50%)+100%"));
|
||||
Assert.assertEquals("150", mathEngine.evaluate("100*50%+100"));
|
||||
Assert.assertEquals("75", mathEngine.evaluate("100+50%-50%"));
|
||||
Assert.assertEquals("75", mathEngine.evaluate("100+50%+(-50%)"));
|
||||
Assert.assertEquals("0", mathEngine.evaluate("0+(-50%)"));
|
||||
Assert.assertEquals("0", mathEngine.evaluate("0+(50%)"));
|
||||
Assert.assertEquals("0", mathEngine.evaluate("0+50%"));
|
||||
Assert.assertEquals("-150", mathEngine.evaluate("-100+50%"));
|
||||
Assert.assertEquals("-148.5", mathEngine.evaluate("1-100+50%"));
|
||||
Assert.assertEquals("-49.5", mathEngine.evaluate("1-100-50%"));
|
||||
Assert.assertEquals("-49.5", mathEngine.evaluate("(1-100)-50%"));
|
||||
Assert.assertEquals("-49", mathEngine.evaluate("1-(100-50%)"));
|
||||
Assert.assertEquals("50", mathEngine.evaluate("100-50%"));
|
||||
Assert.assertEquals("2600", mathEngine.evaluate("100+50%^2"));
|
||||
Assert.assertEquals("101.08138265680029", mathEngine.evaluate("100+50^2%"));
|
||||
Assert.assertEquals("22500", mathEngine.evaluate("(100+50%)^2"));
|
||||
Assert.assertEquals("225", mathEngine.evaluate("(100+50%)+50%"));
|
||||
Assert.assertEquals("225", mathEngine.evaluate("(100+50%)+(abs(-50)+10-10)%"));
|
||||
|
||||
Assert.assertEquals("0", mathEngine.evaluate("100-(10+2*40+10)%"));
|
||||
Assert.assertEquals("3", mathEngine.evaluate("100-(10+2*40+10)%+3"));
|
||||
|
||||
Assert.assertEquals("0", mathEngine.evaluate("100-(200/2)%"));
|
||||
Assert.assertEquals("3", mathEngine.evaluate("100-(200/2)%+3"));
|
||||
|
||||
Assert.assertEquals("99", mathEngine.evaluate("100-2*50%"));
|
||||
Assert.assertEquals("102", mathEngine.evaluate("100-2*50%+3"));
|
||||
|
||||
Assert.assertEquals("84", mathEngine.evaluate("20+2^3!"));
|
||||
Assert.assertEquals("21.0471285480509", mathEngine.evaluate("20+10^2%"));
|
||||
Assert.assertEquals("20.48", mathEngine.evaluate("20+4!*2%"));
|
||||
|
||||
Assert.assertEquals("120", mathEngine.evaluate("100-20+50%"));
|
||||
|
||||
try {
|
||||
mathEngine.evaluate("+50%");
|
||||
Assert.fail();
|
||||
} catch (ParseException e) {
|
||||
}
|
||||
|
||||
Assert.assertEquals("0.5", mathEngine.evaluate("50%"));
|
||||
Assert.assertEquals("-0.5", mathEngine.evaluate("-50%"));
|
||||
Assert.assertEquals("225", mathEngine.evaluate("(100+50%)+50%"));
|
||||
|
||||
}
|
||||
}
|
26
jscl/src/test/java/jscl/math/operator/RandTest.java
Normal file
26
jscl/src/test/java/jscl/math/operator/RandTest.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package jscl.math.operator;
|
||||
|
||||
import jscl.math.Expression;
|
||||
import jscl.text.ParseException;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 12/26/11
|
||||
* Time: 9:56 AM
|
||||
*/
|
||||
public class RandTest {
|
||||
|
||||
@Test
|
||||
public void testRand() throws Exception {
|
||||
/*testRandString("rand()-rand()");
|
||||
testRandString("rand()*rand()");
|
||||
testRandString("rand()^2");
|
||||
testRandString("rand()/rand()");*/
|
||||
}
|
||||
|
||||
private void testRandString(final String expression) throws ParseException {
|
||||
Assert.assertEquals(expression, Expression.valueOf(expression).toString());
|
||||
}
|
||||
}
|
24
jscl/src/test/java/jscl/math/operator/SumTest.java
Normal file
24
jscl/src/test/java/jscl/math/operator/SumTest.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package jscl.math.operator;
|
||||
|
||||
import jscl.JsclMathEngine;
|
||||
import jscl.math.function.Constant;
|
||||
import jscl.math.function.ExtendedConstant;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 1/30/12
|
||||
* Time: 4:17 PM
|
||||
*/
|
||||
public class SumTest {
|
||||
|
||||
@Test
|
||||
public void testExp() throws Exception {
|
||||
final JsclMathEngine me = JsclMathEngine.getInstance();
|
||||
me.getConstantsRegistry().add(new ExtendedConstant.Builder(new Constant("x"), 2d));
|
||||
me.getConstantsRegistry().add(new ExtendedConstant.Builder(new Constant("i"), (String) null));
|
||||
Assert.assertEquals("51.735296462438285", me.evaluate("Σ((1+x/i)^i, i, 1, 10)"));
|
||||
Assert.assertEquals("686.0048440525586", me.evaluate("Σ((1+x/i)^i, i, 1, 100)"));
|
||||
}
|
||||
}
|
20
jscl/src/test/java/jscl/math/operator/stat/MinTest.java
Normal file
20
jscl/src/test/java/jscl/math/operator/stat/MinTest.java
Normal file
@@ -0,0 +1,20 @@
|
||||
package jscl.math.operator.stat;
|
||||
|
||||
import jscl.JsclMathEngine;
|
||||
import jscl.MathEngine;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 1/15/12
|
||||
* Time: 5:03 PM
|
||||
*/
|
||||
public class MinTest {
|
||||
|
||||
@Test
|
||||
public void testFunction() throws Exception {
|
||||
final MathEngine me = JsclMathEngine.getInstance();
|
||||
|
||||
|
||||
}
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
package jscl.math.operator.stat;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 1/15/12
|
||||
* Time: 5:17 PM
|
||||
*/
|
||||
public class StandardDeviationTest {
|
||||
|
||||
@Test
|
||||
public void testFunction() throws Exception {
|
||||
//To change body of created methods use File | Settings | File Templates.
|
||||
}
|
||||
}
|
27
jscl/src/test/java/jscl/text/ParserUtilsTest.java
Normal file
27
jscl/src/test/java/jscl/text/ParserUtilsTest.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package jscl.text;
|
||||
|
||||
import junit.framework.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 11/19/11
|
||||
* Time: 7:22 PM
|
||||
*/
|
||||
public class ParserUtilsTest {
|
||||
@Test
|
||||
public void testCopyOf() throws Exception {
|
||||
final Integer[] array = new Integer[]{1, 2, 3, 7};
|
||||
final Integer[] copy = ParserUtils.copyOf(array);
|
||||
|
||||
Assert.assertEquals(array.length, copy.length);
|
||||
Assert.assertEquals(array[0], copy[0]);
|
||||
Assert.assertEquals(array[1], copy[1]);
|
||||
Assert.assertEquals(array[2], copy[2]);
|
||||
Assert.assertEquals(array[3], copy[3]);
|
||||
|
||||
copy[3] = 12;
|
||||
Assert.assertFalse(array[3].equals(copy[3]));
|
||||
|
||||
}
|
||||
}
|
27
jscl/src/test/java/jscl/text/PowerParserTest.java
Normal file
27
jscl/src/test/java/jscl/text/PowerParserTest.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package jscl.text;
|
||||
|
||||
import jscl.JsclMathEngine;
|
||||
import org.junit.Assert;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 10/27/11
|
||||
* Time: 3:45 PM
|
||||
*/
|
||||
public class PowerParserTest {
|
||||
|
||||
@org.junit.Test
|
||||
public void testParse() throws Exception {
|
||||
PowerParser.parser.parse(Parser.Parameters.newInstance(" ^", new MutableInt(0), JsclMathEngine.getInstance()), null);
|
||||
PowerParser.parser.parse(Parser.Parameters.newInstance(" **", new MutableInt(0), JsclMathEngine.getInstance()), null);
|
||||
PowerParser.parser.parse(Parser.Parameters.newInstance(" **7", new MutableInt(0), JsclMathEngine.getInstance()), null);
|
||||
PowerParser.parser.parse(Parser.Parameters.newInstance("^", new MutableInt(0), JsclMathEngine.getInstance()), null);
|
||||
PowerParser.parser.parse(Parser.Parameters.newInstance("**", new MutableInt(0), JsclMathEngine.getInstance()), null);
|
||||
try {
|
||||
PowerParser.parser.parse(Parser.Parameters.newInstance("*", new MutableInt(0), JsclMathEngine.getInstance()), null);
|
||||
Assert.fail();
|
||||
} catch (ParseException e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
87
jscl/src/test/java/jscl/text/msg/JsclMessageTest.java
Normal file
87
jscl/src/test/java/jscl/text/msg/JsclMessageTest.java
Normal file
@@ -0,0 +1,87 @@
|
||||
package jscl.text.msg;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.solovyev.common.msg.MessageType;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import static java.util.Locale.ENGLISH;
|
||||
import static jscl.text.msg.Messages.msg_1;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.solovyev.common.msg.MessageType.error;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 11/30/11
|
||||
* Time: 9:53 PM
|
||||
*/
|
||||
public class JsclMessageTest {
|
||||
|
||||
private static final Locale[] LOCALES = new Locale[]{
|
||||
Locale.ENGLISH, new Locale("ar"), new Locale("cs"), new Locale("de"), new Locale("es", "ES"), new Locale("fi"), new Locale("fr"), new Locale("it"), new Locale("ja"), new Locale("nl"), new Locale("pl"), new Locale("pt", "BR"), new Locale("pt", "PT"),
|
||||
new Locale("ru"), new Locale("uk"), new Locale("vi"), new Locale("zh", "CN"), new Locale("zh", "TW")
|
||||
};
|
||||
|
||||
@Test
|
||||
public void testTranslation() throws Exception {
|
||||
String localizedMessage = new JsclMessage(msg_1, error).getLocalizedMessage(ENGLISH);
|
||||
assertTrue(localizedMessage.startsWith("Parsing error "));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testShouldContainPolishStrings() throws Exception {
|
||||
String localizedMessage = new JsclMessage(msg_1, error).getLocalizedMessage(new Locale("pl", "PL"));
|
||||
assertTrue(localizedMessage.startsWith("Wystąpił błąd "));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAllMessages() throws Exception {
|
||||
for (int i = 0; i < Messages.COUNT; i++) {
|
||||
final String id = "msg_" + i;
|
||||
final List<String> arguments = makeMessageArguments(i);
|
||||
final JsclMessage message = new JsclMessage(id, MessageType.info, arguments);
|
||||
for (Locale locale : LOCALES) {
|
||||
final String text = message.getLocalizedMessage(locale);
|
||||
assertFalse(text.isEmpty());
|
||||
if (arguments.size() == 1) {
|
||||
assertTrue(text.contains("param0"));
|
||||
} else if (arguments.size() == 2) {
|
||||
assertTrue(text.contains("param1"));
|
||||
assertTrue(text.contains("param2"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
private List<String> makeMessageArguments(int i) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
case 10:
|
||||
case 19:
|
||||
return Arrays.asList("param1", "param2");
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 6:
|
||||
case 8:
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 17:
|
||||
case 20:
|
||||
case 21:
|
||||
return Arrays.asList("param0");
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
@@ -0,0 +1,34 @@
|
||||
package org.solovyev.common.math;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.solovyev.common.JBuilder;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
/**
|
||||
* User: serso
|
||||
* Date: 6/15/13
|
||||
* Time: 9:20 PM
|
||||
*/
|
||||
public abstract class AbstractMathRegistryTest<T extends MathEntity> {
|
||||
|
||||
@Test
|
||||
public void testAdd() throws Exception {
|
||||
final AbstractMathRegistry<T> registry = getRegistry();
|
||||
|
||||
final int oldSize = registry.getEntities().size();
|
||||
|
||||
registry.add(createBuilder("test"));
|
||||
registry.add(createBuilder("test"));
|
||||
registry.add(createBuilder("test1"));
|
||||
|
||||
assertEquals(2, registry.getEntities().size() - oldSize);
|
||||
}
|
||||
|
||||
protected abstract JBuilder<? extends T> createBuilder(@Nonnull String name);
|
||||
|
||||
@Nonnull
|
||||
protected abstract AbstractMathRegistry<T> getRegistry();
|
||||
}
|
257
jscl/src/test/resources/jscl/math/nb_table.csv
Normal file
257
jscl/src/test/resources/jscl/math/nb_table.csv
Normal file
@@ -0,0 +1,257 @@
|
||||
dec hex bin
|
||||
0 0 0
|
||||
1 1 1
|
||||
2 2 10
|
||||
3 3 11
|
||||
4 4 100
|
||||
5 5 101
|
||||
6 6 110
|
||||
7 7 111
|
||||
8 8 1000
|
||||
9 9 1001
|
||||
10 a 1010
|
||||
11 b 1011
|
||||
12 c 1100
|
||||
13 d 1101
|
||||
14 e 1110
|
||||
15 f 1111
|
||||
16 10 10000
|
||||
17 11 10001
|
||||
18 12 10010
|
||||
19 13 10011
|
||||
20 14 10100
|
||||
21 15 10101
|
||||
22 16 10110
|
||||
23 17 10111
|
||||
24 18 11000
|
||||
25 19 11001
|
||||
26 1a 11010
|
||||
27 1b 11011
|
||||
28 1c 11100
|
||||
29 1d 11101
|
||||
30 1e 11110
|
||||
31 1f 11111
|
||||
32 20 100000
|
||||
33 21 100001
|
||||
34 22 100010
|
||||
35 23 100011
|
||||
36 24 100100
|
||||
37 25 100101
|
||||
38 26 100110
|
||||
39 27 100111
|
||||
40 28 101000
|
||||
41 29 101001
|
||||
42 2a 101010
|
||||
43 2b 101011
|
||||
44 2c 101100
|
||||
45 2d 101101
|
||||
46 2e 101110
|
||||
47 2f 101111
|
||||
48 30 110000
|
||||
49 31 110001
|
||||
50 32 110010
|
||||
51 33 110011
|
||||
52 34 110100
|
||||
53 35 110101
|
||||
54 36 110110
|
||||
55 37 110111
|
||||
56 38 111000
|
||||
57 39 111001
|
||||
58 3a 111010
|
||||
59 3b 111011
|
||||
60 3c 111100
|
||||
61 3d 111101
|
||||
62 3e 111110
|
||||
63 3f 111111
|
||||
64 40 1000000
|
||||
65 41 1000001
|
||||
66 42 1000010
|
||||
67 43 1000011
|
||||
68 44 1000100
|
||||
69 45 1000101
|
||||
70 46 1000110
|
||||
71 47 1000111
|
||||
72 48 1001000
|
||||
73 49 1001001
|
||||
74 4a 1001010
|
||||
75 4b 1001011
|
||||
76 4c 1001100
|
||||
77 4d 1001101
|
||||
78 4e 1001110
|
||||
79 4f 1001111
|
||||
80 50 1010000
|
||||
81 51 1010001
|
||||
82 52 1010010
|
||||
83 53 1010011
|
||||
84 54 1010100
|
||||
85 55 1010101
|
||||
86 56 1010110
|
||||
87 57 1010111
|
||||
88 58 1011000
|
||||
89 59 1011001
|
||||
90 5a 1011010
|
||||
91 5b 1011011
|
||||
92 5c 1011100
|
||||
93 5d 1011101
|
||||
94 5e 1011110
|
||||
95 5f 1011111
|
||||
96 60 1100000
|
||||
97 61 1100001
|
||||
98 62 1100010
|
||||
99 63 1100011
|
||||
100 64 1100100
|
||||
101 65 1100101
|
||||
102 66 1100110
|
||||
103 67 1100111
|
||||
104 68 1101000
|
||||
105 69 1101001
|
||||
106 6a 1101010
|
||||
107 6b 1101011
|
||||
108 6c 1101100
|
||||
109 6d 1101101
|
||||
110 6e 1101110
|
||||
111 6f 1101111
|
||||
112 70 1110000
|
||||
113 71 1110001
|
||||
114 72 1110010
|
||||
115 73 1110011
|
||||
116 74 1110100
|
||||
117 75 1110101
|
||||
118 76 1110110
|
||||
119 77 1110111
|
||||
120 78 1111000
|
||||
121 79 1111001
|
||||
122 7a 1111010
|
||||
123 7b 1111011
|
||||
124 7c 1111100
|
||||
125 7d 1111101
|
||||
126 7e 1111110
|
||||
127 7f 1111111
|
||||
128 80 10000000
|
||||
129 81 10000001
|
||||
130 82 10000010
|
||||
131 83 10000011
|
||||
132 84 10000100
|
||||
133 85 10000101
|
||||
134 86 10000110
|
||||
135 87 10000111
|
||||
136 88 10001000
|
||||
137 89 10001001
|
||||
138 8a 10001010
|
||||
139 8b 10001011
|
||||
140 8c 10001100
|
||||
141 8d 10001101
|
||||
142 8e 10001110
|
||||
143 8f 10001111
|
||||
144 90 10010000
|
||||
145 91 10010001
|
||||
146 92 10010010
|
||||
147 93 10010011
|
||||
148 94 10010100
|
||||
149 95 10010101
|
||||
150 96 10010110
|
||||
151 97 10010111
|
||||
152 98 10011000
|
||||
153 99 10011001
|
||||
154 9a 10011010
|
||||
155 9b 10011011
|
||||
156 9c 10011100
|
||||
157 9d 10011101
|
||||
158 9e 10011110
|
||||
159 9f 10011111
|
||||
160 a0 10100000
|
||||
161 a1 10100001
|
||||
162 a2 10100010
|
||||
163 a3 10100011
|
||||
164 a4 10100100
|
||||
165 a5 10100101
|
||||
166 a6 10100110
|
||||
167 a7 10100111
|
||||
168 a8 10101000
|
||||
169 a9 10101001
|
||||
170 aa 10101010
|
||||
171 ab 10101011
|
||||
172 ac 10101100
|
||||
173 ad 10101101
|
||||
174 ae 10101110
|
||||
175 af 10101111
|
||||
176 b0 10110000
|
||||
177 b1 10110001
|
||||
178 b2 10110010
|
||||
179 b3 10110011
|
||||
180 b4 10110100
|
||||
181 b5 10110101
|
||||
182 b6 10110110
|
||||
183 b7 10110111
|
||||
184 b8 10111000
|
||||
185 b9 10111001
|
||||
186 ba 10111010
|
||||
187 bb 10111011
|
||||
188 bc 10111100
|
||||
189 bd 10111101
|
||||
190 be 10111110
|
||||
191 bf 10111111
|
||||
192 c0 11000000
|
||||
193 c1 11000001
|
||||
194 c2 11000010
|
||||
195 c3 11000011
|
||||
196 c4 11000100
|
||||
197 c5 11000101
|
||||
198 c6 11000110
|
||||
199 c7 11000111
|
||||
200 c8 11001000
|
||||
201 c9 11001001
|
||||
202 ca 11001010
|
||||
203 cb 11001011
|
||||
204 cc 11001100
|
||||
205 cd 11001101
|
||||
206 ce 11001110
|
||||
207 cf 11001111
|
||||
208 d0 11010000
|
||||
209 d1 11010001
|
||||
210 d2 11010010
|
||||
211 d3 11010011
|
||||
212 d4 11010100
|
||||
213 d5 11010101
|
||||
214 d6 11010110
|
||||
215 d7 11010111
|
||||
216 d8 11011000
|
||||
217 d9 11011001
|
||||
218 da 11011010
|
||||
219 db 11011011
|
||||
220 dc 11011100
|
||||
221 dd 11011101
|
||||
222 de 11011110
|
||||
223 df 11011111
|
||||
224 e0 11100000
|
||||
225 e1 11100001
|
||||
226 e2 11100010
|
||||
227 e3 11100011
|
||||
228 e4 11100100
|
||||
229 e5 11100101
|
||||
230 e6 11100110
|
||||
231 e7 11100111
|
||||
232 e8 11101000
|
||||
233 e9 11101001
|
||||
234 ea 11101010
|
||||
235 eb 11101011
|
||||
236 ec 11101100
|
||||
237 ed 11101101
|
||||
238 ee 11101110
|
||||
239 ef 11101111
|
||||
240 f0 11110000
|
||||
241 f1 11110001
|
||||
242 f2 11110010
|
||||
243 f3 11110011
|
||||
244 f4 11110100
|
||||
245 f5 11110101
|
||||
246 f6 11110110
|
||||
247 f7 11110111
|
||||
248 f8 11111000
|
||||
249 f9 11111001
|
||||
250 fa 11111010
|
||||
251 fb 11111011
|
||||
252 fc 11111100
|
||||
253 fd 11111101
|
||||
254 fe 11111110
|
||||
255 ff 11111111
|
|
357
jscl/src/test/resources/jscl/math/trig_table.csv
Normal file
357
jscl/src/test/resources/jscl/math/trig_table.csv
Normal file
@@ -0,0 +1,357 @@
|
||||
"X, Angle in degrees" "sin(x)" "cos(x)" "tan(x)" "cot(x)" "Y, Angle in radians" "sinh(y)" "cosh(y)" "tanh(y)" "coth(y)" "asin(sin(x))" "acos(cos(x))" "atan(tan(x))"
|
||||
1 0.017452406437284 0.99984769515639 0.017455064928218 57.289961630759 0.0174532925199433 0.0174541786295951 1.00015231257626 0.0174515205435415 57.3015971591129 0.0174532925199438 0.0174532925200115 0.0174532925199437
|
||||
2 0.034899496702501 0.9993908270191 0.034920769491748 28.636253282916 0.0349065850398866 0.0349136742410173 1.00060929670327 0.0348924144079494 28.6595243398282 0.0349065850398866 0.0349065850397648 0.0349065850398869
|
||||
3 0.052335956242944 0.99862953475457 0.052407779283041 19.081136687728 0.0523598775598299 0.0523838054357798 1.00137109158989 0.0523120807817702 19.1160432744339 0.0523598775598301 0.0523598775599049 0.0523598775598297
|
||||
4 0.069756473744125 0.99756405025982 0.06992681194351 14.300666256712 0.0698131700797732 0.0698698940552625 1.00243792929802 0.0696999704552189 14.3472083771181 0.0698131700797729 0.0698131700798344 0.0698131700797728
|
||||
5 0.087155742747658 0.99619469809175 0.087488663525924 11.430052302761 0.0872664625997165 0.0873772668018779 1.00381013481324 0.0870456112879702 11.4882299659167 0.0872664625997163 0.0872664625996654 0.0872664625997165
|
||||
6 0.10452846326765 0.99452189536827 0.10510423526568 9.5143644542226 0.10471975511966 0.104911256861719 1.00548812614387 0.104338633280596 9.58417767760783 0.104719755119656 0.104719755119692 0.104719755119663
|
||||
7 0.12186934340515 0.99254615164132 0.1227845609029 8.1443464279746 0.122173047639603 0.122477205529182 1.00747241444828 0.12156879312299 8.22579524161525 0.122173047639606 0.12217304763962 0.122173047639599
|
||||
8 0.13917310096007 0.99026806874157 0.14054083470239 7.1153697223842 0.139626340159546 0.140080463834058 1.00976360419059 0.138725998097688 7.20845417378665 0.139626340159551 0.139626340159548 0.139626340159545
|
||||
9 0.15643446504023 0.98768834059514 0.15838444032454 6.313751514675 0.15707963267949 0.157726394171594 1.01236239332483 0.155800329221619 6.41847167458514 0.157079632679489 0.157079632679475 0.157079632679493
|
||||
10 0.17364817766693 0.98480775301221 0.17632698070846 5.6712818196177 0.174532925199433 0.17542037193601 1.01526957350753 0.172782063516364 5.78763778860236 0.174532925199433 0.174532925199422 0.174532925199428
|
||||
11 0.19080899537654 0.98162718344766 0.19438030913772 5.1445540159703 0.191986217719376 0.193167787157981 1.01848603033891 0.189661695304454 5.27254593182221 0.191986217719371 0.191986217719397 0.191986217719378
|
||||
12 0.20791169081776 0.97814760073381 0.21255656167002 4.7046301094785 0.20943951023932 0.210974046146575 1.02201274363261 0.206429956437427 4.84425815544421 0.20943951023932 0.209439510239298 0.209439510239317
|
||||
13 0.22495105434386 0.97437006478524 0.23086819112556 4.3314758742842 0.226892802759263 0.228844573136153 1.02585078771421 0.223077835370251 4.4827402881163 0.226892802759258 0.226892802759242 0.22689280275926
|
||||
14 0.24192189559967 0.970295726276 0.24932800284318 4.0107809335358 0.244346095279206 0.246784811938725 1.03000133174847 0.23959659500614 4.17368201736912 0.244346095279208 0.244346095279191 0.244346095279205
|
||||
15 0.25881904510252 0.96592582628907 0.26794919243112 3.7320508075689 0.261799387799149 0.264800227602271 1.03446564009551 0.255977789245685 3.90658893862159 0.261799387799149 0.261799387799143 0.261799387799147
|
||||
16 0.275637355817 0.96126169593832 0.28674538575881 3.4874144438409 0.279252680319093 0.282896308075536 1.03924507269593 0.272213278184392 3.67359008594217 0.279252680319094 0.279252680319089 0.279252680319095
|
||||
17 0.29237170472274 0.95630475596304 0.30573068145866 3.2708526184841 0.296705972839036 0.301078565879793 1.04434108548512 0.288295241913169 3.46866633442805 0.296705972839039 0.296705972839021 0.296705972839036
|
||||
18 0.30901699437495 0.95105651629515 0.32491969623291 3.0776835371753 0.314159265358979 0.319352539788101 1.04975523083675 0.304216192886744 3.28713600190338 0.314159265358982 0.314159265358991 0.314159265358983
|
||||
19 0.32556815445716 0.94551857559932 0.34432761328967 2.9042108776758 0.331612557878923 0.337723796512546 1.05548915803567 0.319968986835517 3.12530289228956 0.331612557878926 0.331612557878913 0.331612557878927
|
||||
20 0.34202014332567 0.93969262078591 0.3639702342662 2.7474774194546 0.349065850398866 0.356197932400012 1.06154461378034 0.335546832206639 2.98020992605936 0.349065850398867 0.349065850398861 0.349065850398864
|
||||
21 0.3583679495453 0.9335804264972 0.38386403503542 2.6050890646938 0.366519142918809 0.374780575136959 1.06792344271487 0.350943298130241 2.84946316207721 0.366519142918809 0.366519142918814 0.366519142918813
|
||||
22 0.37460659341591 0.92718385456679 0.40402622583516 2.4750868534163 0.383972435438752 0.393477385463767 1.07462758799102 0.366152320916457 2.73110381356333 0.38397243543875 0.383972435438746 0.383972435438755
|
||||
23 0.39073112848927 0.92050485345244 0.4244748162096 2.3558523658238 0.401425727958696 0.412294058899132 1.08165909186006 0.381168209098245 2.62351365127162 0.401425727958692 0.401425727958697 0.401425727958692
|
||||
24 0.4067366430758 0.9135454576426 0.44522868530854 2.2460367739042 0.418879020478639 0.431236327475069 1.08902009629491 0.395985647043824 2.52534405594082 0.418879020478639 0.418879020478641 0.418879020478642
|
||||
25 0.4226182617407 0.90630778703665 0.466307658155 2.1445069205096 0.436332312998582 0.450309961483032 1.0967128436427 0.410599697170813 2.4354620982197 0.436332312998583 0.436332312998582 0.436332312998584
|
||||
26 0.43837114678908 0.89879404629917 0.48773258856586 2.0503038415793 0.453785605518526 0.469520771231691 1.10473967730774 0.425005800801795 2.35290906174328 0.453785605518529 0.453785605518519 0.453785605518525
|
||||
27 0.45399049973955 0.89100652418837 0.50952544949443 1.9626105055052 0.471238898038469 0.488874608816893 1.11310304246546 0.439199777707967 2.27686818335532 0.471238898038473 0.471238898038464 0.47123889803847
|
||||
28 0.46947156278589 0.88294759285893 0.53170943166148 1.8807264653463 0.488692190558412 0.508377369904367 1.12180548680726 0.453177824393821 2.20663930618763 0.488692190558411 0.488692190558406 0.488692190558413
|
||||
29 0.48480962024634 0.8746197071394 0.55430905145277 1.8040477552714 0.506145483078356 0.528034995525681 1.13084966131657 0.46693651118127 2.14161877697285 0.506145483078359 0.506145483078347 0.506145483078356
|
||||
30 0.5 0.86602540378444 0.57735026918963 1.7320508075689 0.523598775598299 0.54785347388804 1.14023832107643 0.480472778156452 2.08128336393364 0.523598775598299 0.523598775598296 0.523598775598302
|
||||
31 0.51503807491005 0.85716730070211 0.60086061902756 1.6642794823505 0.541052068118242 0.567838842198436 1.14997432610874 0.4937839300464 2.02517728737351 0.541052068118237 0.541052068118247 0.541052068118242
|
||||
32 0.5299192642332 0.84804809615643 0.62486935190933 1.6003345290411 0.558505360638185 0.58799718850274 1.16006064224554 0.506867630096088 1.97290168206328 0.55850536063818 0.558505360638178 0.558505360638187
|
||||
33 0.54463903501503 0.83867056794542 0.64940759319751 1.5398649638146 0.575958653158129 0.608334653540269 1.1705003420324 0.519721893018833 1.92410597558522 0.575958653158132 0.575958653158136 0.575958653158128
|
||||
34 0.55919290347075 0.82903757255504 0.67450851684243 1.4825609685127 0.593411945678072 0.628857432614412 1.18129660566447 0.532345077094915 1.87848078817061 0.593411945678076 0.593411945678075 0.593411945678074
|
||||
35 0.57357643635105 0.81915204428899 0.70020753820971 1.4281480067421 0.610865238198015 0.649571777479873 1.1924527219552 0.544735875494339 1.83575204972963 0.61086523819802 0.610865238198018 0.610865238198016
|
||||
36 0.58778525229247 0.80901699437495 0.72654252800536 1.3763819204712 0.628318530717959 0.670483998247118 1.20397208933822 0.556893306900211 1.79567609739506 0.628318530717955 0.628318530717954 0.628318530717958
|
||||
37 0.60181502315205 0.79863551004729 0.75355405010279 1.3270448216204 0.645771823237902 0.691600465304585 1.21585821690258 0.568816705509011 1.75803556807485 0.645771823237904 0.645771823237907 0.645771823237899
|
||||
38 0.61566147532566 0.78801075360672 0.78128562650672 1.2799416321931 0.663225115757845 0.712927611259275 1.2281147254617 0.580505710483406 1.72263593956254 0.663225115757847 0.663225115757848 0.663225115757847
|
||||
39 0.62932039104984 0.77714596145697 0.80978403319501 1.2348971565351 0.680678408277788 0.734471932896275 1.24074534865636 0.59196025493197 1.68930260379546 0.680678408277792 0.68067840827779 0.68067840827779
|
||||
40 0.64278760968654 0.76604444311898 0.83909963117728 1.1917535925942 0.698131700797732 0.756239993157849 1.25375393409209 0.603180554488537 1.657878379133 0.698131700797733 0.698131700797729 0.698131700797732
|
||||
41 0.65605902899051 0.75470958022277 0.86928673781623 1.150368407221 0.715584993317675 0.778238423142676 1.2671444445112 0.61416709556177 1.62822138669822 0.715584993317679 0.715584993317678 0.715584993317677
|
||||
42 0.66913060635886 0.74314482547739 0.90040404429784 1.1106125148292 0.733038285837618 0.800473924125845 1.28092095899998 0.624920623323064 1.60020323010372 0.733038285837621 0.733038285837625 0.733038285837618
|
||||
43 0.6819983600625 0.73135370161917 0.93251508613766 1.0723687100247 0.750491578357562 0.822953269600232 1.29508767423125 0.635442129498088 1.57370742917197 0.750491578357564 0.750491578357562 0.750491578357561
|
||||
44 0.694658370459 0.71933980033865 0.96568877480707 1.0355303137906 0.767944870877505 0.845683307339883 1.3096489057428 0.645732840024197 1.54862806723989 0.767944870877509 0.767944870877507 0.767944870877503
|
||||
45 0.70710678118655 0.70710678118655 1 1 0.785398163397448 0.868670961486009 1.32460908925201 0.655794202632672 1.52486861882206 0.785398163397452 0.785398163397445 0.785398163397448
|
||||
46 0.71933980033865 0.694658370459 1.0355303137906 0.96568877480707 0.802851455917392 0.891923234656263 1.33997278200704 0.66562787441124 1.50234093018493 0.80285145591739 0.802851455917388 0.802851455917406
|
||||
47 0.73135370161917 0.6819983600625 1.0723687100247 0.93251508613766 0.820304748437335 0.915447210077902 1.35574466417516 0.675235709398764 1.48096433005655 0.820304748437334 0.820304748437333 0.820304748437343
|
||||
48 0.74314482547739 0.66913060635886 1.1106125148292 0.90040404429784 0.837758040957278 0.93925005374553 1.37192954026837 0.684619746260292 1.46066485149232 0.837758040957272 0.837758040957276 0.837758040957282
|
||||
49 0.75470958022277 0.65605902899051 1.150368407221 0.86928673781623 0.855211333477221 0.963339016604027 1.38853234060702 0.693782196086903 1.44137454901587 0.855211333477218 0.855211333477218 0.855211333477218
|
||||
50 0.76604444311898 0.64278760968654 1.1917535925942 0.83909963117728 0.872664625997165 0.987721436757379 1.4055581228217 0.702725430361072 1.42303089769525 0.872664625997168 0.872664625997164 0.872664625997161
|
||||
51 0.77714596145697 0.62932039104984 1.2348971565351 0.80978403319501 0.890117918517108 1.01240474170404 1.42301207339391 0.711451969124507 1.40557626290721 0.890117918517107 0.890117918517105 0.890117918517127
|
||||
52 0.78801075360672 0.61566147532566 1.2799416321931 0.78128562650672 0.907571211037051 1.03739645059956 1.440899509236 0.719964469381772 1.38895743127254 0.907571211037048 0.907571211037049 0.907571211037059
|
||||
53 0.79863551004729 0.60181502315205 1.3270448216204 0.75355405010279 0.925024503556995 1.06270417654705 1.45922587931085 0.728265713769363 1.3731251946823 0.92502450355699 0.925024503556993 0.925024503556991
|
||||
54 0.80901699437495 0.58778525229247 1.3763819204712 0.72654252800536 0.942477796076938 1.08833562891639 1.47799676629174 0.736358599516427 1.35803398053164 0.942477796076942 0.942477796076942 0.942477796076947
|
||||
55 0.81915204428899 0.57357643635105 1.4281480067421 0.70020753820971 0.959931088596881 1.11429861569269 1.49721788826297 0.744246127719902 1.34364152227924 0.959931088596878 0.959931088596876 0.959931088596876
|
||||
56 0.82903757255504 0.55919290347075 1.4825609685127 0.67450851684243 0.977384381116825 1.14060104585473 1.51689510046176 0.751931392953616 1.32990856529073 0.977384381116821 0.977384381116821 0.977384381116812
|
||||
57 0.83867056794542 0.54463903501503 1.5398649638146 0.64940759319751 0.994837673636768 1.16725093178432 1.53703439706188 0.759417573227758 1.31679860363211 0.994837673636761 0.994837673636764 0.994837673636773
|
||||
58 0.84804809615643 0.5299192642332 1.6003345290411 0.62486935190933 1.01229096615671 1.19425639170703 1.55764191299961 0.766707920312187 1.30427764407706 1.01229096615672 1.01229096615672 1.01229096615673
|
||||
59 0.85716730070211 0.51503807491005 1.6642794823505 0.60086061902756 1.02974425867665 1.2216256521652 1.57872392584266 0.773805750434261 1.29231399409839 1.02974425867665 1.02974425867666 1.02974425867665
|
||||
60 0.86602540378444 0.5 1.7320508075689 0.57735026918963 1.0471975511966 1.24936705052398 1.60028685770239 0.780714435359268 1.28087807104504 1.0471975511966 1.0471975511966 1.0471975511966
|
||||
61 0.8746197071394 0.48480962024634 1.8040477552714 0.55430905145277 1.06465084371654 1.27748903751106 1.62233727719021 0.78743739385906 1.26994223007269 1.06465084371655 1.06465084371654 1.06465084371654
|
||||
62 0.88294759285893 0.46947156278589 1.8807264653463 0.53170943166148 1.08210413623648 1.30600017979103 1.64488190141852 0.793978083572297 1.25948060870996 1.08210413623649 1.08210413623649 1.08210413623648
|
||||
63 0.89100652418837 0.45399049973955 1.9626105055052 0.50952544949443 1.09955742875643 1.33490916257496 1.66792759804692 0.800339993257551 1.24946898621146 1.09955742875643 1.09955742875642 1.09955742875644
|
||||
64 0.89879404629917 0.43837114678908 2.0503038415793 0.48773258856586 1.11701072127637 1.36422479226612 1.69148138737425 0.806526635438686 1.23988465607968 1.11701072127638 1.11701072127637 1.11701072127637
|
||||
65 0.90630778703665 0.4226182617407 2.1445069205096 0.466307658155 1.13446401379631 1.39395599914269 1.71555044447719 0.812541539440125 1.23070631033712 1.13446401379631 1.13446401379631 1.13446401379632
|
||||
66 0.9135454576426 0.4067366430758 2.2460367739042 0.44522868530854 1.15191730631626 1.42411184007809 1.74014210139592 0.818388244808103 1.22191393430203 1.15191730631626 1.15191730631626 1.15191730631625
|
||||
67 0.92050485345244 0.39073112848927 2.3558523658238 0.4244748162096 1.1693705988362 1.45470150129997 1.76526384936768 0.824070295112569 1.21348871076999 1.1693705988362 1.1693705988362 1.16937059883621
|
||||
68 0.92718385456679 0.37460659341591 2.4750868534163 0.40402622583516 1.18682389135614 1.48573430118855 1.79092334110878 0.829591232123156 1.20541293263276 1.18682389135615 1.18682389135615 1.18682389135614
|
||||
69 0.9335804264972 0.3583679495453 2.6050890646938 0.38386403503542 1.20427718387609 1.51721969311522 1.8171283931458 0.834954590351548 1.19766992307805 1.20427718387608 1.20427718387609 1.20427718387609
|
||||
70 0.93969262078591 0.34202014332567 2.7474774194546 0.3639702342662 1.22173047639603 1.5491672683223 1.84388698819672 0.840163891951616 1.19024396261199 1.22173047639604 1.22173047639603 1.22173047639603
|
||||
71 0.94551857559932 0.32556815445716 2.9042108776758 0.34432761328967 1.23918376891597 1.58158675884476 1.87120727760264 0.845222641967846 1.18312022223139 1.23918376891598 1.23918376891597 1.23918376891597
|
||||
72 0.95105651629515 0.30901699437495 3.0776835371753 0.32491969623291 1.25663706143592 1.61448804047485 1.89909758381088 0.850134323921939 1.17628470214764 1.25663706143591 1.25663706143591 1.25663706143592
|
||||
73 0.95630475596304 0.29237170472274 3.2708526184841 0.30573068145866 1.27409035395586 1.6478811357705 1.92756640291023 0.854902395726829 1.16972417552978 1.27409035395588 1.27409035395586 1.27409035395586
|
||||
74 0.96126169593832 0.275637355817 3.4874144438409 0.28674538575881 1.2915436464758 1.68177621710845 1.95662240721904 0.859530285916931 1.16342613679193 1.29154364647581 1.2915436464758 1.2915436464758
|
||||
75 0.96592582628907 0.25881904510252 3.7320508075689 0.26794919243112 1.30899693899575 1.71618360978304 1.98627444792706 0.864021390183066 1.15737875400067 1.30899693899575 1.30899693899575 1.30899693899575
|
||||
76 0.970295726276 0.24192189559967 4.0107809335358 0.24932800284318 1.32645023151569 1.75111379515149 2.01653155779171 0.868379068200214 1.15157082502297 1.32645023151571 1.32645023151569 1.32645023151569
|
||||
77 0.97437006478524 0.22495105434387 4.3314758742842 0.23086819112556 1.34390352403563 1.78657741382686 2.0474029538897 0.872606640736101 1.14599173707461 1.34390352403566 1.34390352403563 1.34390352403564
|
||||
78 0.97814760073381 0.20791169081776 4.7046301094785 0.21255656167002 1.36135681655558 1.8225852689194 2.07889804042478 0.876707387028461 1.14063142936371 1.3613568165556 1.36135681655558 1.36135681655558
|
||||
79 0.98162718344766 0.19080899537654 5.1445540159703 0.19438030913772 1.37881010907552 1.85914832932744 2.11102641159248 0.880684542418856 1.13548035855544 1.3788101090755 1.37881010907553 1.37881010907552
|
||||
80 0.98480775301221 0.17364817766693 5.6712818196177 0.17632698070847 1.39626340159546 1.89627773307885 2.14379785450277 0.884541296230877 1.13052946681077 1.39626340159548 1.39626340159546 1.39626340159546
|
||||
81 0.98768834059514 0.15643446504023 6.313751514675 0.15838444032454 1.41371669411541 1.93398479072391 2.17722235216144 0.888280789880713 1.12577015217709 1.41371669411542 1.41371669411541 1.41371669411541
|
||||
82 0.99026806874157 0.13917310096007 7.1153697223842 0.14054083470239 1.43116998663535 1.9722809887808 2.2113100865112 0.891906115208149 1.12119424112999 1.43116998663535 1.43116998663535 1.43116998663535
|
||||
83 0.99254615164132 0.12186934340515 8.1443464279746 0.1227845609029 1.44862327915529 2.01117799323469 2.24607144153331 0.895420313016284 1.1167939630847 1.44862327915528 1.44862327915529 1.44862327915529
|
||||
84 0.99452189536827 0.10452846326765 9.5143644542226 0.10510423526568 1.46607657167524 2.05068765309151 2.28151700641086 0.898826371808433 1.11256192671339 1.4660765716752 1.46607657167524 1.46607657167524
|
||||
85 0.99619469809175 0.087155742747658 11.430052302761 0.087488663525924 1.48352986419518 2.0908220039874 2.31765757875444 0.902127226710969 1.10849109791959 1.48352986419523 1.48352986419518 1.48352986419518
|
||||
86 0.99756405025982 0.069756473744125 14.300666256712 0.06992681194351 1.50098315671512 2.13159327185514 2.35450416789143 0.905325758571107 1.10457477933503 1.50098315671506 1.50098315671512 1.50098315671512
|
||||
87 0.99862953475457 0.052335956242944 19.081136687728 0.052407779283041 1.51843644923507 2.17301387664841 2.39206799821965 0.908424793218975 1.10080659121657 1.51843644923499 1.51843644923507 1.51843644923507
|
||||
88 0.9993908270191 0.034899496702501 28.636253282916 0.034920769491748 1.53588974175501 2.21509643612527 2.43036051262665 0.911427100883592 1.09718045363205 1.53588974175513 1.53588974175501 1.53588974175501
|
||||
89 0.99984769515639 0.017452406437284 57.289961630759 0.017455064928218 1.55334303427495 2.25785376969181 2.46939337597547 0.914335395752775 1.09369056983373 1.55334303427489 1.55334303427495 1.55334303427495
|
||||
91 0.99984769515639 -0.017452406437283 -57.28996163076 -0.017455064928218 1.58824961931484 2.34544506845187 2.54972794021739 0.919880521939882 1.0870977003526 1.55334303427489 1.58824961931484 -1.55334303427495
|
||||
92 0.9993908270191 -0.034899496702501 -28.636253282916 -0.034920769491747 1.60570291183478 2.39030571615814 2.59105411303938 0.922522499290548 1.08398440229809 1.53588974175513 1.60570291183478 -1.53588974175501
|
||||
93 0.99862953475457 -0.052335956242944 -19.081136687728 -0.052407779283041 1.62315620435473 2.43589451110775 2.63316958611572 0.925080755888958 1.08098670698111 1.51843644923499 1.62315620435473 -1.51843644923507
|
||||
94 0.99756405025982 -0.069756473744125 -14.300666256712 -0.06992681194351 1.64060949687467 2.4822253407943 2.67608718887883 0.927557723496391 1.07810001972766 1.50098315671506 1.64060949687467 -1.50098315671512
|
||||
95 0.99619469809175 -0.087155742747658 -11.430052302761 -0.087488663525924 1.65806278939461 2.52931231875387 2.71981999510999 0.929955777699027 1.07531994959404 1.48352986419523 1.65806278939461 -1.48352986419518
|
||||
96 0.99452189536827 -0.10452846326765 -9.5143644542226 -0.10510423526568 1.67551608191456 2.57716978886429 2.76438132692196 0.932277238225263 1.07264229887631 1.4660765716752 1.67551608191455 -1.46607657167524
|
||||
97 0.99254615164132 -0.12186934340515 -8.1443464279746 -0.1227845609029 1.6929693744345 2.6258123297147 2.80978475881725 0.93452436933995 1.07006305325809 1.44862327915528 1.6929693744345 -1.44862327915529
|
||||
98 0.99026806874157 -0.13917310096007 -7.1153697223842 -0.14054083470239 1.71042266695444 2.67525475904651 2.85604412182323 0.936699380308836 1.06757837255139 1.43116998663535 1.71042266695445 -1.43116998663535
|
||||
99 0.98768834059514 -0.15643446504023 -6.313751514675 -0.15838444032454 1.72787595947439 2.72551213826731 2.9031735077054 0.938804425926818 1.0651845819887 1.41371669411542 1.72787595947439 -1.41371669411541
|
||||
100 0.98480775301221 -0.17364817766693 -5.6712818196177 -0.17632698070846 1.74532925199433 2.77659977703891 2.95118727326012 0.940841607103994 1.06287816402816 1.39626340159548 1.74532925199433 -1.39626340159546
|
||||
101 0.98162718344766 -0.19080899537654 -5.1445540159703 -0.19438030913772 1.76278254451427 2.82853323794105 3.00010004468806 0.942812971503807 1.06065575063629 1.3788101090755 1.76278254451427 -1.37881010907552
|
||||
102 0.97814760073381 -0.20791169081776 -4.7046301094785 -0.21255656167002 1.78023583703422 2.88132834121219 3.04992672204966 0.944720514227907 1.05851411601586 1.3613568165556 1.78023583703422 -1.36135681655558
|
||||
103 0.97437006478524 -0.22495105434386 -4.3314758742842 -0.23086819112556 1.79768912955416 2.93500116956871 3.10068248380413 0.946566178542686 1.05645016974891 1.34390352403566 1.79768912955415 -1.34390352403564
|
||||
104 0.970295726276 -0.24192189559967 -4.0107809335358 -0.24932800284318 1.8151424220741 2.98956807310414 3.15238279143311 0.948351856642717 1.05446095032715 1.32645023151571 1.81514242207411 -1.32645023151569
|
||||
105 0.96592582628907 -0.25881904510252 -3.7320508075689 -0.26794919243112 1.83259571459405 3.04504567426978 3.20504339415071 0.950079390446654 1.05254361904417 1.30899693899575 1.83259571459405 -1.30899693899575
|
||||
106 0.96126169593832 -0.275637355817 -3.4874144438409 -0.28674538575881 1.85004900711399 3.10145087293836 3.25868033370107 0.951750572421402 1.05069545422583 1.29154364647581 1.85004900711399 -1.2915436464758
|
||||
107 0.95630475596304 -0.29237170472274 -3.2708526184841 -0.30573068145866 1.86750229963393 3.15880085155212 3.31330994924507 0.953367146430669 1.04891384577696 1.27409035395588 1.86750229963394 -1.27409035395586
|
||||
108 0.95105651629515 -0.30901699437495 -3.0776835371753 -0.32491969623291 1.88495559215388 3.21711308035704 3.36894888233769 0.954930808604228 1.04719629002404 1.25663706143591 1.88495559215388 -1.25663706143592
|
||||
109 0.94551857559932 -0.32556815445716 -2.9042108776758 -0.34432761328966 1.90240888467382 3.27640532272471 3.42561408199739 0.95644320822453 1.04554038483511 1.23918376891598 1.90240888467382 -1.23918376891597
|
||||
110 0.93969262078591 -0.34202014332567 -2.7474774194546 -0.3639702342662 1.91986217719376 3.33669564056352 3.48332280986927 0.957905948627466 1.04394382499957 1.22173047639604 1.91986217719376 -1.22173047639603
|
||||
111 0.9335804264972 -0.3583679495453 -2.6050890646938 -0.38386403503542 1.93731546971371 3.39800239982072 3.54209264548336 0.959320588114378 1.04240439785159 1.20427718387608 1.93731546971371 -1.20427718387609
|
||||
112 0.92718385456679 -0.37460659341591 -2.4750868534163 -0.40402622583516 1.95476876223365 3.4603442760772 3.6019414916098 0.960688640872587 1.04091997912217 1.18682389135615 1.95476876223365 -1.18682389135614
|
||||
113 0.92050485345244 -0.39073112848927 -2.3558523658238 -0.4244748162096 1.97222205475359 3.52374026023653 3.66288757971246 0.96201157790192 1.03948852900599 1.1693705988362 1.97222205475359 -1.16937059883621
|
||||
114 0.9135454576426 -0.4067366430758 -2.2460367739042 -0.44522868530854 1.98967534727354 3.58820966431005 3.72494947550273 0.963290827944929 1.03810808842994 1.15191730631626 1.98967534727354 -1.15191730631625
|
||||
115 0.90630778703665 -0.4226182617407 -2.1445069205096 -0.466307658155 2.00712863979348 3.65377212729981 3.78814608459508 0.964527778418655 1.03677677551133 1.13446401379631 2.00712863979348 -1.13446401379632
|
||||
116 0.89879404629917 -0.43837114678908 -2.0503038415793 -0.48773258856586 2.02458193231342 3.7204476211811 3.85249665826618 0.965723776345983 1.03549278219462 1.11701072127638 2.02458193231342 -1.11701072127637
|
||||
117 0.89100652418837 -0.45399049973955 -1.9626105055052 -0.50952544949443 2.04203522483337 3.78825645698641 3.91802079931937 0.966880129284789 1.03425437105602 1.09955742875643 2.04203522483337 -1.09955742875644
|
||||
118 0.88294759285893 -0.46947156278589 -1.8807264653463 -0.53170943166148 2.05948851735331 3.85721929099268 3.9847384680561 0.967998106253225 1.03305987226632 1.08210413623649 2.05948851735331 -1.08210413623648
|
||||
119 0.8746197071394 -0.48480962024634 -1.8040477552714 -0.55430905145277 2.07694180987325 3.92735713101375 4.05266998835638 0.969078938649663 1.0319076807029 1.06465084371655 2.07694180987326 -1.06465084371654
|
||||
120 0.86602540378444 -0.5 -1.7320508075689 -0.57735026918963 2.0943951023932 3.99869134279982 4.12183605386995 0.970123821165931 1.03079625320216 1.0471975511966 2.0943951023932 -1.0471975511966
|
||||
121 0.85716730070211 -0.51503807491005 -1.6642794823505 -0.60086061902756 2.11184839491314 4.07124365654605 4.19225773432007 0.971133912692597 1.02972410594474 1.02974425867665 2.11184839491313 -1.02974425867665
|
||||
122 0.84804809615643 -0.5299192642332 -1.6003345290411 -0.62486935190933 2.12930168743308 4.14503617351207 4.26395648192188 0.972110337215213 1.02868981196587 1.01229096615672 2.12930168743308 -1.01229096615673
|
||||
123 0.83867056794542 -0.54463903501503 -1.5398649638146 -0.64940759319751 2.14675497995303 4.22009137275462 4.3369541379173 0.97305418470051 1.027691998784 0.994837673636761 2.14675497995303 -0.994837673636773
|
||||
124 0.82903757255504 -0.55919290347075 -1.4825609685127 -0.67450851684243 2.16420827247297 4.29643211797521 4.41127293922842 0.973966511971645 1.02672934614113 0.977384381116821 2.16420827247297 -0.977384381116812
|
||||
125 0.81915204428899 -0.57357643635105 -1.4281480067421 -0.70020753820971 2.18166156499291 4.374081664485 4.48693552523143 0.974848343571727 1.02580058384889 0.959931088596878 2.18166156499292 -0.959931088596876
|
||||
126 0.80901699437495 -0.58778525229247 -1.3763819204712 -0.72654252800536 2.19911485751286 4.45306366628894 4.56396494465314 0.975700672614911 1.02490448973451 0.942477796076942 2.19911485751285 -0.942477796076947
|
||||
127 0.79863551004729 -0.60181502315205 -1.3270448216204 -0.75355405010279 2.2165681500328 4.53340218329138 4.64238466259217 0.97652446162444 1.02403988768137 0.92502450355699 2.2165681500328 -0.925024503556991
|
||||
128 0.78801075360672 -0.61566147532566 -1.2799416321931 -0.78128562650672 2.23402144255274 4.61512168862529 4.72221856766707 0.977320643357116 1.02320564575919 0.907571211037048 2.23402144255274 -0.907571211037059
|
||||
129 0.77714596145697 -0.62932039104984 -1.2348971565351 -0.80978403319501 2.25147473507268 4.69824707610748 4.80349097929334 0.978090121613731 1.022400674439 0.890117918517107 2.25147473507269 -0.890117918517127
|
||||
130 0.76604444311898 -0.64278760968654 -1.1917535925942 -0.83909963117728 2.26892802759263 4.78280366782176 4.88622665509177 0.978833772035067 1.02162392488862 0.872664625997168 2.26892802759263 -0.872664625997161
|
||||
131 0.75470958022277 -0.65605902899051 -1.150368407221 -0.86928673781623 2.28638132011257 4.8688172218328 4.97045079843022 0.979552442883144 1.02087438734436 0.855211333477218 2.28638132011258 -0.855211333477218
|
||||
132 0.74314482547739 -0.66913060635886 -1.1106125148292 -0.90040404429784 2.30383461263251 4.95631394003259 5.05618906610121 0.980246955807444 1.02015108955507 0.837758040957272 2.30383461263252 -0.837758040957282
|
||||
133 0.73135370161917 -0.6819983600625 -1.0723687100247 -0.93251508613766 2.32128790515246 5.04532047612227 5.14346757613759 0.980918106595897 1.0194530952949 0.820304748437334 2.32128790515246 -0.820304748437343
|
||||
134 0.71933980033865 -0.694658370459 -1.0355303137906 -0.96568877480707 2.3387411976724 5.13586394373147 5.23231291576879 0.98156666591047 1.01877950294128 0.80285145591739 2.33874119767241 -0.802851455917406
|
||||
135 0.70710678118655 -0.70710678118655 -1 -1 2.35619449019234 5.2279719246778 5.32275214951996 0.982193380007239 1.01812944411479 0.785398163397452 2.35619449019235 -0.785398163397448
|
||||
136 0.694658370459 -0.71933980033865 -0.96568877480707 -1.0355303137906 2.37364778271229 5.32167247736903 5.41481282745646 0.982798971440868 1.01750208237796 0.767944870877509 2.37364778271229 -0.767944870877503
|
||||
137 0.6819983600625 -0.73135370161917 -0.93251508613766 -1.0723687100247 2.39110107523223 5.4169941453503 5.50852299357636 0.983384139753471 1.01689661198999 0.750491578357564 2.39110107523223 -0.750491578357561
|
||||
138 0.66913060635886 -0.74314482547739 -0.90040404429784 -1.1106125148292 2.40855436775217 5.51396596599926 5.60391119435329 0.983949562147832 1.0163122567148 0.733038285837621 2.40855436775217 -0.733038285837618
|
||||
139 0.65605902899051 -0.75470958022277 -0.86928673781623 -1.150368407221 2.42600766027212 5.61261747937156 5.70100648743247 0.984495894145049 1.01574826867959 0.715584993317679 2.42600766027211 -0.715584993317677
|
||||
140 0.64278760968654 -0.76604444311898 -0.83909963117728 -1.1917535925942 2.44346095279206 5.71297873719951 5.79983845048237 0.985023770226629 1.0152039272818 0.698131700797733 2.44346095279206 -0.698131700797732
|
||||
141 0.62932039104984 -0.77714596145697 -0.80978403319501 -1.2348971565351 2.460914245312 5.81508031204659 5.90043719020479 0.98553380446115 1.01467853814183 0.680678408277792 2.460914245312 -0.68067840827779
|
||||
142 0.61566147532566 -0.78801075360672 -0.78128562650672 -1.2799416321931 2.47836753783195 5.91895330662059 6.00283335150617 0.986026591115588 1.01417143209962 0.663225115757847 2.47836753783194 -0.663225115757847
|
||||
143 0.60181502315205 -0.79863551004729 -0.75355405010279 -1.3270448216204 2.49582083035189 6.02462936324835 6.10705812683277 0.986502705251444 1.01368196425282 0.645771823237904 2.49582083035189 -0.645771823237899
|
||||
144 0.58778525229247 -0.80901699437495 -0.72654252800536 -1.3763819204712 2.51327412287183 6.13214067351471 6.21314326567266 0.986962703305832 1.01320951303479 0.628318530717955 2.51327412287184 -0.628318530717958
|
||||
145 0.57357643635105 -0.81915204428899 -0.70020753820971 -1.4281480067421 2.53072741539178 6.24151998806898 6.32112108422743 0.987407123657689 1.01275347933045 0.61086523819802 2.53072741539177 -0.610865238198016
|
||||
146 0.55919290347075 -0.82903757255504 -0.67450851684243 -1.4825609685127 2.54818070791172 6.35280062660152 6.43102447525654 0.9878364871793 1.01231328562831 0.593411945678076 2.54818070791172 -0.593411945678074
|
||||
147 0.54463903501503 -0.83867056794542 -0.64940759319751 -1.5398649638146 2.56563400043166 6.46601648799383 6.54288691809724 0.988251297773343 1.01188837520692 0.575958653158132 2.56563400043166 -0.575958653158128
|
||||
148 0.5299192642332 -0.84804809615643 -0.62486935190933 -1.6003345290411 2.58308729295161 6.58120206064494 6.65674248886325 0.988652042895653 1.01147821135443 0.55850536063818 2.58308729295162 -0.558505360638187
|
||||
149 0.51503807491005 -0.85716730070211 -0.60086061902756 -1.6642794823505 2.60054058547155 6.6983924329775 6.77262587082516 0.989039194063939 1.01108227661942 0.541052068118237 2.60054058547155 -0.541052068118242
|
||||
150 0.5 -0.86602540378444 -0.57735026918963 -1.7320508075689 2.61799387799149 6.81762330412654 6.89057236497588 0.989413207352682 1.01070007209187 0.523598775598299 2.6179938779915 -0.523598775598302
|
||||
151 0.48480962024634 -0.8746197071394 -0.55430905145277 -1.8040477552714 2.63544717051144 6.93893099481438 7.01061790078419 0.989774523874452 1.01033111671285 0.506145483078359 2.63544717051145 -0.506145483078356
|
||||
152 0.46947156278589 -0.88294759285893 -0.53170943166148 -1.8807264653463 2.65290046303138 7.06235245841479 7.13279904713973 0.990123570247897 1.00997494661159 0.488692190558411 2.65290046303139 -0.488692190558413
|
||||
153 0.45399049973955 -0.89100652418837 -0.50952544949443 -1.9626105055052 2.67035375555132 7.18792529220995 7.25715302349285 0.990460759052647 1.00963111446886 0.471238898038473 2.67035375555133 -0.47123889803847
|
||||
154 0.43837114678908 -0.89879404629917 -0.48773258856586 -2.0503038415793 2.68780704807127 7.31568774884349 7.38371771119257 0.990786489271394 1.00929918890535 0.453785605518529 2.68780704807127 -0.453785605518525
|
||||
155 0.4226182617407 -0.90630778703665 -0.466307658155 -2.1445069205096 2.70526034059121 7.44567874797327 7.51253166502616 0.991101146719405 1.00897875389414 0.436332312998583 2.70526034059121 -0.436332312998584
|
||||
156 0.4067366430758 -0.9135454576426 -0.44522868530854 -2.2460367739042 2.72271363311115 7.5779378881272 7.64363412496398 0.991405104461736 1.00866940819609 0.418879020478639 2.72271363311115 -0.418879020478642
|
||||
157 0.39073112848927 -0.92050485345244 -0.4244748162096 -2.3558523658238 2.7401669256311 7.71250545876605 7.77706502811286 0.991698723218407 1.00837076481721 0.401425727958692 2.7401669256311 -0.401425727958692
|
||||
158 0.37460659341591 -0.92718385456679 -0.40402622583516 -2.4750868534163 2.75762021815104 7.84942245255652 7.91286502088204 0.991982351757791 1.00808245048715 0.38397243543875 2.75762021815105 -0.383972435438755
|
||||
159 0.3583679495453 -0.9335804264972 -0.38386403503542 -2.6050890646938 2.77507351067098 7.98873057785875 8.05107547136501 0.99225632727851 1.00780410515772 0.366519142918809 2.77507351067098 -0.366519142918813
|
||||
160 0.34202014332567 -0.93969262078591 -0.3639702342662 -2.7474774194546 2.79252680319093 8.13047227143164 8.19173848194134 0.992520975780078 1.00753538152082 0.349065850398867 2.79252680319093 -0.349065850398864
|
||||
161 0.32556815445716 -0.94551857559932 -0.34432761328967 -2.9042108776758 2.80998009571087 8.27469071136021 8.33489690210209 0.992776612422561 1.00727594454488 0.331612557878926 2.80998009571088 -0.331612557878927
|
||||
162 0.30901699437495 -0.95105651629515 -0.32491969623291 -3.0776835371753 2.82743338823081 8.42142983020873 8.48059434150281 0.993023541875534 1.0070254710289 0.314159265358982 2.8274333882308 -0.314159265358983
|
||||
163 0.29237170472274 -0.95630475596304 -0.30573068145866 -3.2708526184841 2.84488668075076 8.57073432840366 8.62887518324822 0.993262058656564 1.00678364917366 0.296705972839039 2.84488668075077 -0.296705972839036
|
||||
164 0.275637355817 -0.96126169593832 -0.28674538575881 -3.4874144438409 2.8623399732707 8.72264968785052 8.77978459741233 0.993492447459514 1.00655017816907 0.279252680319094 2.8623399732707 -0.279252680319095
|
||||
165 0.25881904510252 -0.96592582628907 -0.26794919243112 -3.7320508075689 2.87979326579064 8.87722218578886 8.93336855479847 0.993714983472898 1.00632476779724 0.261799387799149 2.87979326579065 -0.261799387799147
|
||||
166 0.24192189559967 -0.970295726276 -0.24932800284318 -4.0107809335358 2.89724655831059 9.03449890888945 9.08967384094306 0.993929932688554 1.00610713805049 0.244346095279208 2.8972465583106 -0.244346095279205
|
||||
167 0.22495105434387 -0.97437006478524 -0.23086819112556 -4.3314758742842 2.91469985083053 9.19452776759802 9.24874807036774 0.994137552200882 1.00589701876379 0.226892802759268 2.91469985083055 -0.22689280275926
|
||||
168 0.20791169081776 -0.97814760073381 -0.21255656167002 -4.7046301094785 2.93215314335047 9.35735751073009 9.41063970108392 0.994338090496899 1.00569414926091 0.20943951023932 2.93215314335049 -0.209439510239317
|
||||
169 0.19080899537654 -0.98162718344766 -0.19438030913772 -5.1445540159703 2.94960643587042 9.52303774032098 9.57539804935428 0.994531787737343 1.00549827801392 0.191986217719371 2.9496064358704 -0.191986217719378
|
||||
170 0.17364817766693 -0.98480775301221 -0.17632698070847 -5.6712818196177 2.96705972839036 9.6916189267359 9.74307330471579 0.994718876029087 1.00530916231528 0.174532925199433 2.96705972839037 -0.174532925199438
|
||||
171 0.15643446504023 -0.98768834059514 -0.15838444032454 -6.313751514675 2.9845130209103 9.86315242404448 9.9137165452687 0.994899579689077 1.00512656796228 0.157079632679489 2.98451302091032 -0.157079632679493
|
||||
172 0.13917310096007 -0.99026806874157 -0.14054083470239 -7.1153697223842 3.00196631343025 10.0376904856645 10.0873797532362 0.995074115500038 1.00495026895307 0.139626340159551 3.00196631343024 -0.139626340159545
|
||||
173 0.12186934340515 -0.99254615164132 -0.1227845609029 -8.1443464279746 3.01941960595019 10.2152862802796 10.2641158307995 0.995242692958183 1.00478004719399 0.122173047639606 3.01941960595017 -0.122173047639599
|
||||
174 0.10452846326765 -0.99452189536827 -0.10510423526568 -9.5143644542226 3.03687289847013 10.3959939080357 10.4439786162131 0.995405514513132 1.00461569221777 0.104719755119656 3.0368728984701 -0.104719755119663
|
||||
175 0.087155742747658 -0.99619469809175 -0.087488663525924 -11.430052302761 3.05432619099008 10.5798684170217 10.6270229002055 0.995562775800272 1.00445700091203 0.0872664625997163 3.05432619099013 -0.0872664625997165
|
||||
176 0.069756473744126 -0.99756405025982 -0.069926811943511 -14.300666256712 3.07177948351002 10.7669658200377 10.8133044426697 0.99571466586577 1.00430377725782 0.0698131700797739 3.07177948350996 -0.0698131700797738
|
||||
177 0.052335956242944 -0.99862953475457 -0.052407779283042 -19.081136687728 3.08923277602996 10.9573431116588 11.0028799896489 0.995861367384452 1.00415583207773 0.0523598775598301 3.08923277602989 -0.0523598775598307
|
||||
178 0.034899496702501 -0.9993908270191 -0.034920769491748 -28.636253282915 3.10668606854991 11.1510582855964 11.195807290623 0.996003056870752 1.00401298279325 0.0349065850398866 3.10668606855003 -0.0349065850398869
|
||||
179 0.017452406437283 -0.99984769515639 -0.017455064928218 -57.28996163076 3.12413936106985 11.3481703523649 11.3921451161006 0.996139904882926 1.00387505319097 0.0174532925199428 3.12413936106978 -0.0174532925199437
|
||||
181 -0.017452406437283 -0.99984769515639 0.017455064928217 57.28996163076 3.15904594610974 11.7528263986386 11.795292635477 0.99639973011686 1.00361327866148 -0.0174532925199428 3.12413936106978 0.0174532925199427
|
||||
182 -0.034899496702501 -0.9993908270191 0.034920769491748 28.636253282916 3.17649923862968 11.9604936465537 12.0022251382504 0.996523020421957 1.00348911114624 -0.0349065850398866 3.10668606855003 0.0349065850398869
|
||||
183 -0.052335956242944 -0.99862953475457 0.052407779283041 19.081136687728 3.19395253114962 12.1718043616699 12.2128138206871 0.99664209578404 1.00336921772637 -0.0523598775598301 3.08923277602989 0.0523598775598297
|
||||
184 -0.069756473744125 -0.99756405025982 0.06992681194351 14.300666256712 3.21140582366957 12.3868229145462 12.4271228333966 0.996757099821844 1.00325345079432 -0.0698131700797729 3.07177948350996 0.0698131700797728
|
||||
185 -0.087155742747658 -0.99619469809175 0.087488663525924 11.430052302761 3.22885911618951 12.605614805242 12.6452174602944 0.996868171292678 1.00314166787296 -0.0872664625997163 3.05432619099013 0.0872664625997165
|
||||
186 -0.10452846326765 -0.99452189536827 0.10510423526568 9.5143644542226 3.24631240870945 12.8282466832703 12.8671641384897 0.996975444254807 1.00303373143503 -0.104719755119656 3.0368728984701 0.104719755119663
|
||||
187 -0.12186934340515 -0.99254615164132 0.1227845609029 8.1443464279746 3.2637657012294 13.054786367901 13.0930304785231 0.997079048224565 1.00292950872916 -0.122173047639606 3.01941960595017 0.122173047639599
|
||||
188 -0.13917310096007 -0.99026806874157 0.14054083470239 7.1153697223842 3.28121899374934 13.2853028688201 13.3228852849628 0.997179108328346 1.00282887161202 -0.139626340159551 3.00196631343024 0.139626340159545
|
||||
189 -0.15643446504023 -0.98768834059514 0.15838444032454 6.313751514675 3.29867228626928 13.5198664071517 13.5567985773644 0.997275745449641 1.00273169638667 -0.157079632679489 2.98451302091032 0.157079632679493
|
||||
190 -0.17364817766693 -0.98480775301221 0.17632698070847 5.6712818196177 3.31612557878923 13.7585484368496 13.7948416116002 0.997369076371266 1.00263786364653 -0.174532925199433 2.96705972839037 0.174532925199438
|
||||
191 -0.19080899537654 -0.98162718344766 0.19438030913772 5.1445540159703 3.33357887130917 14.0014216664634 14.0370869015658 0.997459213912935 1.00254725812507 -0.191986217719371 2.9496064358704 0.191986217719378
|
||||
192 -0.20791169081776 -0.97814760073381 0.21255656167002 4.7046301094785 3.35103216382911 14.2485600812877 14.2836082412697 0.997546267064323 1.00245976855078 -0.20943951023932 2.93215314335049 0.209439510239317
|
||||
193 -0.22495105434386 -0.97437006478524 0.23086819112556 4.3314758742842 3.36848545634906 14.5000389658999 14.5344807273124 0.997630341113751 1.0023752875074 -0.226892802759258 2.91469985083055 0.22689280275926
|
||||
194 -0.24192189559967 -0.970295726276 0.24932800284318 4.0107809335358 3.385938748869 14.7559349270936 14.7897807817635 0.997711537772647 1.00229371129902 -0.244346095279208 2.8972465583106 0.244346095279205
|
||||
195 -0.25881904510252 -0.96592582628907 0.26794919243112 3.7320508075689 3.40339204138894 15.0163259172148 15.0495861754408 0.9977899552959 1.00221493982012 -0.261799387799149 2.87979326579065 0.261799387799147
|
||||
196 -0.275637355817 -0.96126169593832 0.28674538575881 3.4874144438409 3.42084533390889 15.2812912579088 15.313976051602 0.99786568859824 1.00213887643011 -0.279252680319094 2.8623399732707 0.279252680319095
|
||||
197 -0.29237170472274 -0.95630475596304 0.30573068145866 3.2708526184841 3.43829862642883 15.5509116642828 15.5830309500536 0.997938829366784 1.00206542783241 -0.296705972839039 2.84488668075077 0.296705972839036
|
||||
198 -0.30901699437495 -0.95105651629515 0.32491969623291 3.0776835371753 3.45575191894877 15.8252692694943 15.8568328316849 0.998009466169843 1.00199450395776 -0.314159265358982 2.8274333882308 0.314159265358983
|
||||
199 -0.32556815445716 -0.94551857559932 0.34432761328967 2.9042108776758 3.47320521146872 16.1044476497706 16.135465103436 0.998077684562137 1.00192601785171 -0.331612557878926 2.80998009571088 0.331612557878927
|
||||
200 -0.34202014332567 -0.93969262078591 0.3639702342662 2.7474774194546 3.49065850398866 16.3885318498683 16.419012643705 0.998143567186515 1.00185988556608 -0.349065850398867 2.79252680319093 0.349065850398864
|
||||
201 -0.3583679495453 -0.9335804264972 0.38386403503542 2.6050890646938 3.5081117965086 16.6776084089802 16.7075618282048 0.998207193872294 1.00179602605422 -0.366519142918809 2.77507351067098 0.366519142918813
|
||||
202 -0.37460659341591 -0.92718385456679 0.40402622583516 2.4750868534163 3.52556508902855 16.9717653870972 17.0012005562746 0.998268641730333 1.00173436107005 -0.38397243543875 2.75762021815105 0.383972435438755
|
||||
203 -0.39073112848927 -0.92050485345244 0.4244748162096 2.3558523658238 3.54301838154849 17.2710923918338 17.3000182776568 0.998327985244943 1.00167481507057 -0.401425727958692 2.7401669256311 0.401425727958692
|
||||
204 -0.4067366430758 -0.9135454576426 0.44522868530854 2.2460367739042 3.56047167406843 17.5756806057242 17.6041060197452 0.998385296362727 1.00161731512188 -0.418879020478639 2.72271363311115 0.418879020478642
|
||||
205 -0.4226182617407 -0.90630778703665 0.466307658155 2.1445069205096 3.57792496658838 17.8856228139997 17.9135564153148 0.998440644578469 1.0015617908085 -0.436332312998583 2.70526034059121 0.436332312998584
|
||||
206 -0.43837114678908 -0.89879404629917 0.48773258856586 2.0503038415793 3.59537825910832 18.2010134328527 18.2284637307394 0.998494097018144 1.0015081741458 -0.453785605518529 2.68780704807127 0.453785605518525
|
||||
207 -0.45399049973955 -0.89100652418837 0.50952544949443 1.9626105055052 3.61283155162826 18.5219485381985 18.5489238947081 0.998545718519159 1.00145639949566 -0.471238898038473 2.67035375555133 0.47123889803847
|
||||
208 -0.46947156278589 -0.88294759285893 0.53170943166148 1.8807264653463 3.63028484414821 18.8485258949427 18.8750345274472 0.998595571707909 1.00140640348494 -0.488692190558411 2.65290046303139 0.488692190558413
|
||||
209 -0.48480962024634 -0.8746197071394 0.55430905145277 1.8040477552714 3.64773813666815 19.1808449867622 19.2068949704579 0.99864371707474 1.00135812492691 -0.506145483078359 2.63544717051145 0.506145483078356
|
||||
210 -0.5 -0.86602540378444 0.57735026918963 1.7320508075689 3.66519142918809 19.5190070464112 19.5446063167783 0.998690213046393 1.00131150474541 -0.523598775598299 2.6179938779915 0.523598775598302
|
||||
211 -0.51503807491005 -0.85716730070211 0.60086061902756 1.6642794823505 3.68264472170804 19.8631150865585 19.8882714417787 0.998735116056024 1.00126648590166 -0.541052068118237 2.60054058547155 0.541052068118242
|
||||
212 -0.5299192642332 -0.84804809615643 0.62486935190933 1.6003345290411 3.70009801422798 20.2132739311685 20.2379950345002 0.998778480610871 1.00122301332362 -0.55850536063818 2.58308729295162 0.558505360638187
|
||||
213 -0.54463903501503 -0.83867056794542 0.64940759319751 1.5398649638146 3.71755130674792 20.5695902474326 20.5938836295458 0.998820359357652 1.00118103383786 -0.575958653158132 2.56563400043166 0.575958653158128
|
||||
214 -0.55919290347075 -0.82903757255504 0.67450851684243 1.4825609685127 3.73500459926786 20.9321725782629 20.9560456395328 0.998860803145759 1.00114049610382 -0.593411945678076 2.54818070791172 0.593411945678074
|
||||
215 -0.57357643635105 -0.81915204428899 0.70020753820971 1.4281480067421 3.75245789178781 21.3011313753573 21.3245913881188 0.998899861088331 1.00110135055027 -0.61086523819802 2.53072741539177 0.610865238198016
|
||||
216 -0.58778525229247 -0.80901699437495 0.72654252800536 1.3763819204712 3.76991118430775 21.6765790328456 21.6996331436087 0.99893758062127 1.00106354931413 -0.628318530717955 2.51327412287184 0.628318530717958
|
||||
217 -0.60181502315205 -0.79863551004729 0.75355405010279 1.3270448216204 3.7873644768277 22.0586299215277 22.0812851531544 0.998974007560268 1.00102704618135 -0.645771823237904 2.49582083035189 0.645771823237899
|
||||
218 -0.61566147532566 -0.78801075360672 0.78128562650672 1.2799416321931 3.80481776934764 22.447400423714 22.4696636775576 0.999009186155914 1.00099179652982 -0.663225115757847 2.47836753783194 0.663225115757847
|
||||
219 -0.62932039104984 -0.77714596145697 0.80978403319501 1.2348971565351 3.82227106186758 22.8430089686778 22.8648870266856 0.999043159146938 1.00095775727435 -0.680678408277792 2.460914245312 0.68067840827779
|
||||
220 -0.64278760968654 -0.76604444311898 0.83909963117728 1.1917535925942 3.83972435438752 23.2455760687325 23.2670755955111 0.999075967811667 1.00092488681352 -0.698131700797733 2.44346095279206 0.698131700797732
|
||||
221 -0.65605902899051 -0.75470958022277 0.86928673781623 1.150368407221 3.85717764690747 23.6552243559425 23.6763519007885 0.999107652017734 1.00089314497839 -0.715584993317679 2.42600766027211 0.715584993317677
|
||||
222 -0.66913060635886 -0.74314482547739 0.90040404429784 1.1106125148292 3.87463093942741 24.0720786194796 24.0928406183747 0.999138250270112 1.00086249298298 -0.733038285837621 2.40855436775217 0.733038285837618
|
||||
223 -0.6819983600625 -0.73135370161917 0.93251508613766 1.0723687100247 3.89208423194735 24.4962658436374 24.5166686212086 0.999167799757525 1.00083289337654 -0.750491578357564 2.39110107523223 0.750491578357561
|
||||
224 -0.694658370459 -0.71933980033865 0.96568877480707 1.0355303137906 3.9095375244673 24.9279152465139 24.9479650179605 0.999196336397291 1.00080430999738 -0.767944870877509 2.37364778271229 0.767944870877503
|
||||
225 -0.70710678118655 -0.70710678118655 1 1 3.92699081698724 25.3671583193742 25.3868611923608 0.999223894878641 1.00077670792836 -0.785398163397452 2.35619449019235 0.785398163397448
|
||||
226 -0.71933980033865 -0.694658370459 1.0355303137906 0.96568877480707 3.94444410950718 25.8141288667063 25.8334908432236 0.999250508704579 1.00075005345396 -0.80285145591739 2.33874119767241 0.802851455917406
|
||||
227 -0.73135370161917 -0.6819983600625 1.0723687100247 0.93251508613766 3.96189740202713 26.2689630469814 26.2879900251745 0.99927621023232 1.00072431401876 -0.820304748437334 2.32128790515246 0.820304748437343
|
||||
228 -0.74314482547739 -0.66913060635886 1.1106125148292 0.90040404429784 3.97935069454707 26.7317994141311 26.7504971900961 0.999301030712359 1.00069945818743 -0.837758040957272 2.30383461263252 0.837758040957282
|
||||
229 -0.75470958022277 -0.65605902899051 1.150368407221 0.86928673781623 3.99680398706701 27.2027789597543 27.221153229304 0.999325000326217 1.0006754556061 -0.855211333477218 2.28638132011258 0.855211333477218
|
||||
230 -0.76604444311898 -0.64278760968654 1.1917535925942 0.83909963117728 4.01425727958696 27.6820451560668 27.700101516466 0.999348148222906 1.00065227696499 -0.872664625997168 2.26892802759263 0.872664625997161
|
||||
231 -0.77714596145697 -0.62932039104984 1.2348971565351 0.80978403319501 4.0317105721069 28.1697439996069 28.187487951277 0.999370502554154 1.00062989396249 -0.890117918517107 2.25147473507269 0.890117918517127
|
||||
232 -0.78801075360672 -0.61566147532566 1.2799416321931 0.78128562650672 4.04916386462685 28.6660240557091 28.6834610039042 0.999392090508439 1.0006082792703 -0.907571211037048 2.23402144255274 0.907571211037059
|
||||
233 -0.79863551004729 -0.60181502315205 1.3270448216204 0.75355405010279 4.06661715714679 29.1710365037612 29.1881717602143 0.999412938343867 1.00058740649997 -0.92502450355699 2.2165681500328 0.925024503556991
|
||||
234 -0.80901699437495 -0.58778525229247 1.3763819204712 0.72654252800536 4.08407044966673 29.6849351832573 29.7017739677984 0.999433071419931 1.0005672501704 -0.942477796076942 2.19911485751285 0.942477796076947
|
||||
235 -0.81915204428899 -0.57357643635105 1.4281480067421 0.70020753820971 4.10152374218667 30.2078766406609 30.2244240828073 0.999452514228191 1.00054778567667 -0.959931088596878 2.18166156499292 0.959931088596876
|
||||
236 -0.82903757255504 -0.55919290347075 1.4825609685127 0.67450851684243 4.11897703470662 30.7400201770932 30.7562813176121 0.999471290421914 1.00052898925977 -0.977384381116821 2.16420827247297 0.977384381116812
|
||||
237 -0.83867056794542 -0.54463903501503 1.5398649638146 0.64940759319751 4.13643032722656 31.2815278968602 31.297507689304 0.999489422844706 1.0005108379775 -0.994837673636761 2.14675497995303 0.994837673636773
|
||||
238 -0.84804809615643 -0.52991926423321 1.6003345290411 0.62486935190933 4.1538836197465 31.8325647568337 31.848268069049 0.999506933558166 1.00049330967628 -1.01229096615672 2.12930168743309 1.01229096615673
|
||||
239 -0.85716730070211 -0.51503807491005 1.6642794823505 0.60086061902756 4.17133691226645 32.393298616701 32.4087302323119 0.999523843868605 1.00047638296406 -1.02974425867665 2.11184839491313 1.02974425867665
|
||||
240 -0.86602540378444 -0.5 1.7320508075689 0.57735026918963 4.18879020478639 32.9639002900999 32.9790649099645 0.999540174352852 1.00046003718404 -1.0471975511966 2.0943951023932 1.0471975511966
|
||||
241 -0.8746197071394 -0.48480962024634 1.8040477552714 0.55430905145277 4.20624349730633 33.5445435966521 33.559445840295 0.999555944883184 1.00044425238936 -1.06465084371655 2.07694180987326 1.06465084371654
|
||||
242 -0.88294759285893 -0.46947156278589 1.8807264653463 0.53170943166148 4.22369678982628 34.1354054149134 34.1500498219329 0.999571174651403 1.00042900931867 -1.08210413623649 2.05948851735331 1.08210413623648
|
||||
243 -0.89100652418837 -0.45399049973955 1.9626105055051 0.50952544949443 4.24115008234622 34.7366657362553 34.7510567677061 0.999585882192101 1.00041428937251 -1.09955742875643 2.04203522483337 1.09955742875642
|
||||
244 -0.89879404629917 -0.43837114678908 2.0503038415793 0.48773258856586 4.25860337486616 35.3485077196949 35.3626497594472 0.999600085405124 1.00040007459054 -1.11701072127638 2.02458193231342 1.11701072127637
|
||||
245 -0.90630778703665 -0.4226182617407 2.1445069205096 0.466307658155 4.27605666738611 35.9711177476897 35.9850151037645 0.999613801577276 1.00038634762957 -1.13446401379631 2.00712863979348 1.13446401379632
|
||||
246 -0.9135454576426 -0.4067366430758 2.2460367739042 0.44522868530854 4.29350995990605 36.6046854829145 36.6183423887959 0.99962704740328 1.00037309174225 -1.15191730631626 1.98967534727354 1.15191730631625
|
||||
247 -0.92050485345244 -0.39073112848927 2.3558523658238 0.4244748162096 4.31096325242599 37.2494039260371 37.2628245419623 0.999639839006029 1.00036029075665 -1.1693705988362 1.97222205475359 1.16937059883621
|
||||
248 -0.92718385456679 -0.37460659341591 2.4750868534163 0.40402622583516 4.32841654494594 37.9054694745118 37.9186578887379 0.999652191956139 1.00034792905639 -1.18682389135615 1.95476876223365 1.18682389135614
|
||||
249 -0.9335804264972 -0.3583679495453 2.6050890646938 0.38386403503542 4.34586983746588 38.5730819824062 38.5860422124559 0.999664121290845 1.00033599156157 -1.20427718387608 1.93731546971371 1.20427718387609
|
||||
250 -0.93969262078591 -0.34202014332567 2.7474774194546 0.3639702342662 4.36332312998582 39.2524448212824 39.2651808151678 0.999675641532244 1.00032446371031 -1.22173047639604 1.91986217719376 1.22173047639603
|
||||
251 -0.94551857559932 -0.32556815445716 2.9042108776758 0.34432761328967 4.38077642250577 39.9437649421488 39.9562805795739 0.999686766704919 1.00031333144092 -1.23918376891598 1.90240888467382 1.23918376891597
|
||||
252 -0.95105651629515 -0.30901699437495 3.0776835371753 0.32491969623291 4.39822971502571 40.6472529385026 40.6595520320454 0.999697510352964 1.00030258117471 -1.25663706143591 1.88495559215388 1.25663706143592
|
||||
253 -0.95630475596304 -0.29237170472274 3.2708526184841 0.30573068145866 4.41568300754565 41.363123110482 41.3752094067558 0.999707885556422 1.00029219979936 -1.27409035395588 1.86750229963394 1.27409035395586
|
||||
254 -0.96126169593832 -0.275637355817 3.4874144438409 0.28674538575881 4.4331363000656 42.0915935301475 42.103470710942 0.99971790494717 1.0002821746529 -1.29154364647581 1.85004900711399 1.2915436464758
|
||||
255 -0.96592582628907 -0.25881904510252 3.7320508075689 0.26794919243112 4.45058959258554 42.8328861079115 42.8445577913148 0.99972758072425 1.00027249350823 -1.30899693899575 1.83259571459405 1.30899693899575
|
||||
256 -0.970295726276 -0.24192189559967 4.0107809335358 0.24932800284318 4.46804288510548 43.5872266601387 43.5986964016392 0.999736924668691 1.00026314455815 -1.32645023151571 1.81514242207411 1.32645023151569
|
||||
257 -0.97437006478524 -0.22495105434387 4.3314758742842 0.23086819112556 4.48549617762543 44.3548449779348 44.3661162715042 0.999745948157815 1.00025411640093 -1.34390352403566 1.79768912955416 1.34390352403564
|
||||
258 -0.97814760073381 -0.20791169081776 4.7046301094784 0.21255656167002 4.50294947014537 45.1359748971471 45.1470511763049 0.999754662179053 1.00024539802636 -1.3613568165556 1.78023583703422 1.36135681655557
|
||||
259 -0.98162718344766 -0.19080899537654 5.1445540159703 0.19438030913772 4.52040276266531 45.9308543695963 45.9417390084557 0.999763077343297 1.00023697880235 -1.3788101090755 1.76278254451427 1.37881010907552
|
||||
260 -0.98480775301221 -0.17364817766693 5.6712818196177 0.17632698070846 4.53785605518526 46.7397255355628 46.7504218498586 0.999771203897791 1.00022884846184 -1.39626340159548 1.74532925199433 1.39626340159546
|
||||
261 -0.98768834059514 -0.15643446504023 6.313751514675 0.15838444032454 4.5553093477052 47.562834797549 47.5733460456476 0.999779051738582 1.00022099709034 -1.41371669411542 1.72787595947439 1.41371669411541
|
||||
262 -0.99026806874157 -0.13917310096007 7.1153697223842 0.14054083470239 4.57276264022514 48.4004328953393 48.4107622792313 0.999786630422541 1.00021341511375 -1.43116998663535 1.71042266695445 1.43116998663535
|
||||
263 -0.99254615164132 -0.12186934340515 8.1443464279746 0.12278456090291 4.59021593274509 49.2527749823821 49.2629256486576 0.999793949178986 1.00020609328671 -1.44862327915528 1.6929693744345 1.44862327915529
|
||||
264 -0.99452189536827 -0.10452846326765 9.5143644542225 0.10510423526568 4.60766922526503 50.1201207035156 50.1300957443228 0.999801016920891 1.00019902268125 -1.4660765716752 1.67551608191455 1.46607657167524
|
||||
265 -0.99619469809175 -0.087155742747658 11.430052302761 0.087488663525924 4.62512251778497 51.0027342740623 51.0125367280496 0.999807842255727 1.00019219467597 -1.48352986419523 1.65806278939461 1.48352986419518
|
||||
266 -0.99756405025982 -0.069756473744126 14.300666256712 0.069926811943511 4.64257581030492 51.9008845603159 51.9105174135573 0.99981443349592 1.0001856009454 -1.50098315671506 1.64060949687467 1.50098315671512
|
||||
267 -0.99862953475457 -0.052335956242943 19.081136687728 0.052407779283041 4.66002910282486 52.8148451614442 52.8243113483491 0.99982079866896 1.00017923344991 -1.51843644923499 1.62315620435473 1.51843644923507
|
||||
268 -0.9993908270191 -0.034899496702501 28.636253282916 0.034920769491748 4.6774823953448 53.7448944928348 53.7541968970418 0.999826945527158 1.00017308442588 -1.53588974175513 1.60570291183478 1.53588974175501
|
||||
269 -0.99984769515639 -0.017452406437283 57.289961630759 0.017455064928218 4.69493568786475 54.691315870907 54.7004573261625 0.999832881557078 1.00016714637616 -1.55334303427489 1.58824961931484 1.55334303427495
|
||||
271 -0.99984769515639 0.017452406437283 -57.289961630761 -0.017455064928217 4.72984227290463 56.6344330572848 56.643260920608 0.999844149803883 1.00015587448919 -1.55334303427489 1.55334303427495 -1.55334303427495
|
||||
272 -0.9993908270191 0.0348994967025 -28.636253282916 -0.034920769491747 4.74729556542458 57.6317207879597 57.6403959127741 0.999849495745526 1.00015052690941 -1.53588974175513 1.53588974175501 -1.53588974175501
|
||||
273 -0.99862953475457 0.052335956242943 -19.081136687728 -0.05240777928304 4.76474885794452 58.6465645903691 58.655089619336 0.999854658325097 1.00014536280218 -1.51843644923499 1.51843644923507 -1.51843644923507
|
||||
274 -0.99756405025982 0.069756473744125 -14.300666256712 -0.06992681194351 4.78220215046446 59.6792736114613 59.6876511415188 0.999859643830887 1.00014037587173 -1.50098315671506 1.50098315671512 -1.50098315671512
|
||||
275 -0.99619469809175 0.087155742747658 -11.430052302761 -0.087488663525924 4.79965544298441 60.7301624403791 60.7383950235338 0.999864458335597 1.00013556003844 -1.48352986419523 1.48352986419518 -1.48352986419518
|
||||
276 -0.99452189536827 0.10452846326765 -9.5143644542225 -0.10510423526568 4.81710873550435 61.7995512042926 61.8076413483962 0.999869107703721 1.00013090943131 -1.4660765716752 1.46607657167524 -1.46607657167524
|
||||
277 -0.99254615164132 0.12186934340515 -8.1443464279746 -0.1227845609029 4.83456202802429 62.8877656659169 62.8957158354309 0.999873597598685 1.0001264183809 -1.44862327915528 1.44862327915529 -1.44862327915529
|
||||
278 -0.99026806874157 0.13917310096007 -7.1153697223842 -0.14054083470239 4.85201532054424 63.9951373227483 64.0029499394943 0.999877933489732 1.00012208141232 -1.43116998663535 1.43116998663535 -1.43116998663535
|
||||
279 -0.98768834059514 0.15643446504023 -6.3137515146751 -0.15838444032454 4.86946861306418 65.1220035080468 65.1296809519443 0.99988212065858 1.0001178932386 -1.41371669411542 1.41371669411541 -1.41371669411541
|
||||
280 -0.98480775301221 0.17364817766693 -5.6712818196177 -0.17632698070846 4.88692190558412 66.2687074935959 66.2762521033874 0.999886164205848 1.00011384875422 -1.39626340159548 1.39626340159546 -1.39626340159546
|
||||
281 -0.98162718344766 0.19080899537654 -5.1445540159703 -0.19438030913772 4.90437519810407 67.435598594272 67.4430126682356 0.999890069057265 1.00010994302888 -1.3788101090755 1.37881010907553 -1.37881010907552
|
||||
282 -0.97814760073381 0.20791169081776 -4.7046301094785 -0.21255656167002 4.92182849062401 68.6230322744548 68.6303180711037 0.999893839969656 1.00010617130149 -1.3613568165556 1.36135681655558 -1.36135681655558
|
||||
283 -0.97437006478524 0.22495105434386 -4.3314758742842 -0.23086819112556 4.93928178314395 69.83137025631 69.8385299950812 0.999897481536743 1.00010252897437 -1.34390352403566 1.34390352403564 -1.34390352403564
|
||||
284 -0.970295726276 0.24192189559967 -4.0107809335358 -0.24932800284318 4.9567350756639 71.0609806299797 71.0680164919097 0.999900998194725 1.0000990116076 -1.32645023151571 1.32645023151569 -1.32645023151569
|
||||
285 -0.96592582628907 0.25881904510252 -3.7320508075689 -0.26794919243112 4.97418836818384 72.3122379657115 72.3191520941009 0.999904394227682 1.00009561491366 -1.30899693899575 1.30899693899575 -1.30899693899575
|
||||
286 -0.96126169593832 0.275637355817 -3.4874144438409 -0.28674538575881 4.99164166070378 73.5855234279623 73.5923179290284 0.99990767377279 1.00009233475213 -1.29154364647581 1.2915436464758 -1.2915436464758
|
||||
287 -0.95630475596304 0.29237170472274 -3.2708526184841 -0.30573068145866 5.00909495322373 74.88122489151 74.8879018350287 0.999910840825352 1.00008916712472 -1.27409035395588 1.27409035395586 -1.27409035395586
|
||||
288 -0.95105651629515 0.30901699437495 -3.0776835371753 -0.32491969623291 5.02654824574367 76.1997370596106 76.2062984795469 0.999913899243669 1.00008610817031 -1.25663706143591 1.25663706143591 -1.25663706143592
|
||||
289 -0.94551857559932 0.32556815445716 -2.9042108776758 -0.34432761328966 5.04400153826361 77.5414615842345 77.5479094793619 0.999916852753727 1.00008315416031 -1.23918376891598 1.23918376891597 -1.23918376891597
|
||||
290 -0.93969262078591 0.34202014332567 -2.7474774194546 -0.3639702342662 5.06145483078356 78.9068071884196 78.9131435229292 0.999919704953741 1.00008030149407 -1.22173047639604 1.22173047639603 -1.22173047639603
|
||||
291 -0.9335804264972 0.3583679495453 -2.6050890646938 -0.38386403503542 5.0789081233035 80.2961897907787 80.3024164948774 0.99992245931853 1.00007754669449 -1.20427718387608 1.20427718387609 -1.20427718387609
|
||||
292 -0.92718385456679 0.37460659341591 -2.4750868534163 -0.40402622583516 5.09636141582344 81.710032632199 81.7161516026974 0.999925119203751 1.0000748864038 -1.18682389135615 1.18682389135615 -1.18682389135614
|
||||
293 -0.92050485345244 0.39073112848927 -2.3558523658238 -0.4244748162096 5.11381470834339 83.1487664047718 83.1547795056622 0.99992768784998 1.00007231737944 -1.1693705988362 1.1693705988362 -1.16937059883621
|
||||
294 -0.9135454576426 0.4067366430758 -2.2460367739042 -0.44522868530854 5.13126800086333 84.6128293829918 84.6187384460161 0.999930168386662 1.00006983649013 -1.15191730631626 1.15191730631626 -1.15191730631625
|
||||
295 -0.90630778703665 0.4226182617407 -2.1445069205096 -0.466307658155 5.14872129338327 86.1026675572673 86.1084743824747 0.999932563835918 1.00006744071203 -1.13446401379631 1.13446401379631 -1.13446401379632
|
||||
296 -0.89879404629917 0.43837114678908 -2.0503038415793 -0.48773258856586 5.16617458590322 87.6187347697791 87.6244411260745 0.999934877116224 1.00006512712504 -1.11701072127638 1.11701072127637 -1.11701072127637
|
||||
297 -0.89100652418837 0.45399049973955 -1.9626105055052 -0.50952544949443 5.18362787842316 89.1614928527332 89.1671004784163 0.999937111045968 1.0000628929093 -1.09955742875643 1.09955742875642 -1.09955742875644
|
||||
298 -0.88294759285893 0.46947156278589 -1.8807264653463 -0.53170943166148 5.2010811709431 90.7314117690457 90.7369223723404 0.99993926834688 1.00006073534168 -1.08210413623649 1.08210413623649 -1.08210413623648
|
||||
299 -0.8746197071394 0.48480962024634 -1.8040477552714 -0.55430905145277 5.21853446346305 92.3289697555063 92.3343850150809 0.999941351647344 1.00005865179249 -1.06465084371655 1.06465084371654 -1.06465084371654
|
||||
300 -0.86602540378444 0.5 -1.7320508075689 -0.57735026918963 5.23598775598299 93.9546534684599 93.9599750339387 0.999943363485603 1.00005663972227 -1.0471975511966 1.0471975511966 -1.0471975511966
|
||||
301 -0.85716730070211 0.51503807491005 -1.6642794823505 -0.60086061902756 5.25344104850293 95.6089581320556 95.6141876245213 0.999945306312843 1.00005469667872 -1.02974425867665 1.02974425867666 -1.02974425867665
|
||||
302 -0.84804809615643 0.5299192642332 -1.6003345290411 -0.62486935190933 5.27089434102288 97.2923876891039 97.2975267015914 0.999947182496187 1.00005282029365 -1.01229096615672 1.01229096615672 -1.01229096615673
|
||||
303 -0.83867056794542 0.54463903501503 -1.5398649638146 -0.64940759319751 5.28834763354282 99.0054549545903 99.0105050525721 0.999948994321571 1.00005100828014 -0.994837673636761 0.994837673636764 -0.994837673636773
|
||||
304 -0.82903757255504 0.55919290347075 -1.4825609685127 -0.67450851684243 5.30580092606276 100.748681771892 100.753644493755 0.999950743996528 1.00004925842975 -0.977384381116821 0.977384381116821 -0.977384381116812
|
||||
305 -0.81915204428899 0.57357643635105 -1.4281480067421 -0.70020753820971 5.32325421858271 102.522599171744 102.527476029258 0.999952433652881 1.00004756860978 -0.959931088596878 0.959931088596876 -0.959931088596876
|
||||
306 -0.80901699437495 0.58778525229247 -1.3763819204712 -0.72654252800536 5.34070751110265 104.327747534004 104.332540012783 0.999954065349334 1.00004593676076 -0.942477796076942 0.942477796076942 -0.942477796076947
|
||||
307 -0.79863551004729 0.60181502315205 -1.3270448216204 -0.75355405010279 5.35816080362259 106.164676752269 106.169386312221 0.999955641073983 1.00004436089382 -0.92502450355699 0.925024503556993 -0.925024503556991
|
||||
308 -0.78801075360672 0.61566147532566 -1.2799416321931 -0.78128562650672 5.37561409614254 108.03394640138 108.038574477158 0.999957162746735 1.00004283908837 -0.907571211037048 0.907571211037049 -0.907571211037059
|
||||
309 -0.77714596145697 0.62932039104984 -1.2348971565351 -0.80978403319501 5.39306738866248 109.936125907891 109.940673909321 0.999958632221649 1.00004136948971 -0.890117918517107 0.890117918517105 -0.890117918517127
|
||||
310 -0.76604444311898 0.64278760968654 -1.1917535925942 -0.83909963117728 5.41052068118242 111.871794723523 111.876264036042 0.99996005128919 1.00003995030677 -0.872664625997168 0.872664625997164 -0.872664625997161
|
||||
311 -0.75470958022277 0.65605902899051 -1.150368407221 -0.86928673781623 5.42797397370237 113.841542501685 113.845934486757 0.999961421678414 1.00003857980993 -0.855211333477218 0.855211333477218 -0.855211333477218
|
||||
312 -0.74314482547739 0.66913060635886 -1.1106125148292 -0.90040404429784 5.44542726622231 115.845969277093 115.850285272628 0.99996274505907 1.00003725632891 -0.837758040957272 0.837758040957276 -0.837758040957282
|
||||
313 -0.73135370161917 0.6819983600625 -1.0723687100247 -0.93251508613766 5.46288055874225 117.885685648561 117.889926969319 0.99996402304364 1.00003597825075 -0.820304748437334 0.820304748437333 -0.820304748437343
|
||||
314 -0.71933980033865 0.694658370459 -1.0355303137906 -0.96568877480707 5.4803338512622 119.961312964998 119.965480902992 0.999965257189294 1.00003474401781 -0.80285145591739 0.802851455917388 -0.802851455917406
|
||||
315 -0.70710678118655 0.70710678118655 -1 -1 5.49778714378214 122.073483514693 122.077579339582 0.999966448999796 1.00003355212591 -0.785398163397452 0.785398163397445 -0.785398163397448
|
||||
316 -0.694658370459 0.71933980033865 -0.96568877480707 -1.0355303137906 5.51524043630208 124.222840717921 124.226865677397 0.999967599927328 1.00003240112247 -0.767944870877509 0.767944870877507 -0.767944870877503
|
||||
317 -0.6819983600625 0.73135370161917 -0.93251508613766 -1.0723687100247 5.53269372882203 126.410039322949 126.413994643115 0.999968711374265 1.00003128960474 -0.750491578357564 0.750491578357562 -0.750491578357561
|
||||
318 -0.66913060635886 0.74314482547739 -0.90040404429784 -1.1106125148292 5.55014702134197 128.635745605484 128.639632491231 0.99996978469488 1.00003021621811 -0.733038285837621 0.733038285837625 -0.733038285837618
|
||||
319 -0.65605902899051 0.75470958022277 -0.86928673781623 -1.150368407221 5.56760031386191 130.900637571644 130.904457207013 0.999970821196992 1.00002917965444 -0.715584993317679 0.715584993317678 -0.715584993317677
|
||||
320 -0.64278760968654 0.76604444311898 -0.83909963117728 -1.1917535925942 5.58505360638185 133.205405164487 133.209158713037 0.999971822143564 1.00002817865045 -0.698131700797733 0.698131700797729 -0.698131700797732
|
||||
321 -0.62932039104984 0.77714596145697 -0.80978403319501 -1.2348971565351 5.6025068989018 135.550750474194 135.55443907935 0.999972788754238 1.00002721198623 -0.680678408277792 0.68067840827779 -0.68067840827779
|
||||
322 -0.61566147532566 0.78801075360672 -0.78128562650672 -1.2799416321931 5.61996019142174 137.937387951938 137.941012737342 0.999973722206821 1.00002627848372 -0.663225115757847 0.663225115757848 -0.663225115757847
|
||||
323 -0.60181502315205 0.79863551004729 -0.75355405010279 -1.3270448216204 5.63741348394168 140.366044627524 140.369606697376 0.999974623638721 1.00002537700526 -0.645771823237904 0.645771823237907 -0.645771823237899
|
||||
324 -0.58778525229247 0.80901699437495 -0.72654252800536 -1.3763819204712 5.65486677646163 142.837460330862 142.840960770259 0.999975494148332 1.00002450645222 -0.628318530717955 0.628318530717954 -0.628318530717958
|
||||
325 -0.57357643635105 0.81915204428899 -0.70020753820971 -1.4281480067421 5.67232006898157 145.352387917338 145.355827792601 0.999976334796373 1.00002366576368 -0.61086523819802 0.610865238198018 -0.610865238198016
|
||||
326 -0.55919290347075 0.82903757255504 -0.67450851684243 -1.4825609685127 5.68977336150152 147.911593497152 147.914973856154 0.999977146607176 1.00002285391511 -0.593411945678076 0.593411945678075 -0.593411945678074
|
||||
327 -0.54463903501503 0.83867056794542 -0.64940759319751 -1.5398649638146 5.70722665402146 150.515856668693 150.519178541176 0.999977930569941 1.00002206991713 -0.575958653158132 0.575958653158136 -0.575958653158128
|
||||
328 -0.52991926423321 0.84804809615643 -0.62486935190933 -1.6003345290411 5.7246799465414 153.165970756027 153.169235153918 0.999978687639934 1.00002131281429 -0.558505360638191 0.558505360638178 -0.558505360638187
|
||||
329 -0.51503807491005 0.85716730070211 -0.60086061902756 -1.6642794823505 5.74213323906134 155.862743050563 155.865950968278 0.999979418739656 1.00002058168394 -0.541052068118237 0.541052068118247 -0.541052068118242
|
||||
330 -0.5 0.86602540378444 -0.57735026918963 -1.7320508075689 5.75958653158129 158.606995056971 158.610147471724 0.999980124759965 1.00001987563507 -0.523598775598299 0.523598775598296 -0.523598775598302
|
||||
331 -0.48480962024634 0.8746197071394 -0.55430905145277 -1.8040477552714 5.77703982410123 161.399562743438 161.402660615534 0.99998080656116 1.00001919380724 -0.506145483078359 0.506145483078347 -0.506145483078356
|
||||
332 -0.46947156278589 0.88294759285893 -0.53170943166148 -1.8807264653463 5.79449311662117 164.241296796322 164.244341069449 0.99998146497403 1.00001853536952 -0.488692190558411 0.488692190558406 -0.488692190558413
|
||||
333 -0.45399049973955 0.89100652418837 -0.50952544949443 -1.9626105055051 5.81194640914112 167.133062879291 167.136054480812 0.999982100800868 1.00001789951952 -0.471238898038473 0.471238898038464 -0.47123889803847
|
||||
334 -0.43837114678908 0.89879404629917 -0.48773258856586 -2.0503038415793 5.82939970166106 170.07574189703 170.078681738262 0.999982714816446 1.00001728548234 -0.453785605518529 0.453785605518519 -0.453785605518525
|
||||
335 -0.4226182617407 0.90630778703665 -0.466307658155 -2.1445069205096 5.846852994181 173.070230263582 173.073119240076 0.99998330776896 1.00001669250968 -0.436332312998583 0.436332312998582 -0.436332312998584
|
||||
336 -0.4067366430758 0.9135454576426 -0.44522868530854 -2.2460367739042 5.86430628670095 176.117440175425 176.120279167234 0.99998388038094 1.00001611987891 -0.418879020478639 0.418879020478641 -0.418879020478642
|
||||
337 -0.39073112848927 0.92050485345244 -0.4244748162096 -2.3558523658238 5.88175957922089 179.218299889341 179.221089761293 0.999984433350134 1.00001556689219 -0.401425727958692 0.401425727958697 -0.401425727958692
|
||||
338 -0.37460659341591 0.92718385456679 -0.40402622583516 -2.4750868534163 5.89921287174083 182.373754005193 182.376495607155 0.999984967350354 1.00001503287563 -0.38397243543875 0.383972435438746 -0.383972435438755
|
||||
339 -0.3583679495453 0.9335804264972 -0.38386403503542 -2.6050890646938 5.91666616426078 185.584763753674 185.587457920806 0.9999854830323 1.00001451717845 -0.366519142918809 0.366519142918814 -0.366519142918813
|
||||
340 -0.34202014332567 0.93969262078591 -0.3639702342662 -2.7474774194546 5.93411945678072 188.852307289118 188.854954842131 0.99998598102435 1.00001401917218 -0.349065850398867 0.349065850398861 -0.349065850398864
|
||||
341 -0.32556815445716 0.94551857559932 -0.34432761328967 -2.9042108776758 5.95157274930066 192.177379987472 192.179981732877 0.999986461933328 1.00001353824995 -0.331612557878926 0.331612557878913 -0.331612557878927
|
||||
342 -0.30901699437495 0.95105651629515 -0.32491969623291 -3.0776835371753 5.96902604182061 195.560994749514 195.563551479869 0.999986926345242 1.00001307382568 -0.314159265358982 0.314159265358991 -0.314159265358983
|
||||
343 -0.29237170472274 0.95630475596304 -0.30573068145866 -3.2708526184841 5.98647933434055 199.004182309407 199.006694803556 0.999987374826 1.0000126253334 -0.296705972839039 0.296705972839021 -0.296705972839036
|
||||
344 -0.275637355817 0.96126169593832 -0.28674538575881 -3.4874144438409 6.00393262686049 202.507991548687 202.510460571999 0.999987807922095 1.00001219222655 -0.279252680319094 0.279252680319089 -0.279252680319095
|
||||
345 -0.25881904510252 0.96592582628907 -0.26794919243112 -3.7320508075689 6.02138591938044 206.073489815777 206.075916120379 0.999988226161277 1.00001177397735 -0.261799387799149 0.261799387799143 -0.261799387799147
|
||||
346 -0.24192189559967 0.970295726276 -0.24932800284318 -4.0107809335358 6.03883921190038 209.701763251132 209.704147576136 0.999988630053189 1.00001137007609 -0.244346095279208 0.244346095279191 -0.244346095279205
|
||||
347 -0.22495105434387 0.97437006478524 -0.23086819112556 -4.3314758742841 6.05629250442032 213.393917118099 213.396260189831 0.999989020089996 1.00001098003056 -0.226892802759268 0.226892802759242 -0.22689280275926
|
||||
348 -0.20791169081776 0.97814760073381 -0.21255656167002 -4.7046301094784 6.07374579694027 217.151076139614 217.153378671832 0.999989396746977 1.00001060336545 -0.20943951023932 0.209439510239298 -0.209439510239317
|
||||
349 -0.19080899537654 0.98162718344766 -0.19438030913772 -5.1445540159703 6.09119908946021 220.974384840816 220.97664753493 0.999989760483109 1.00001023962174 -0.191986217719371 0.191986217719397 -0.191986217719378
|
||||
350 -0.17364817766693 0.98480775301221 -0.17632698070847 -5.6712818196177 6.10865238198015 224.865007897701 224.867231442985 0.999990111741626 1.00000988835615 -0.174532925199433 0.174532925199422 -0.174532925199438
|
||||
351 -0.15643446504023 0.98768834059514 -0.15838444032454 -6.313751514675 6.1261056745001 228.824130491912 228.826315565714 0.999990450950555 1.00000954914063 -0.157079632679489 0.157079632679475 -0.157079632679493
|
||||
352 -0.13917310096007 0.99026806874157 -0.14054083470239 -7.1153697223842 6.14355896702004 232.852958671773 232.855105939721 0.999990778523242 1.00000922156179 -0.139626340159551 0.139626340159548 -0.139626340159545
|
||||
353 -0.12186934340515 0.99254615164132 -0.12278456090291 -8.1443464279746 6.16101225953998 236.952719719683 236.954829835888 0.999991094858853 1.00000890522045 -0.122173047639606 0.12217304763962 -0.122173047639608
|
||||
354 -0.10452846326765 0.99452189536827 -0.10510423526568 -9.5143644542225 6.17846555205993 241.124662525975 241.126736133232 0.999991400342864 1.00000859973109 -0.104719755119656 0.104719755119692 -0.104719755119663
|
||||
355 -0.087155742747658 0.99619469809175 -0.087488663525924 -11.430052302761 6.19591884457987 245.370057969364 245.372095699346 0.999991695347524 1.00000830472144 -0.0872664625997163 0.0872664625996654 -0.0872664625997165
|
||||
356 -0.069756473744126 0.99756405025982 -0.069926811943511 -14.300666256712 6.21337213709981 249.690199304084 249.692201777535 0.999991980232315 1.000008019832 -0.0698131700797739 0.0698131700798344 -0.0698131700797738
|
||||
357 -0.052335956242943 0.99862953475457 -0.052407779283041 -19.081136687728 6.23082542961976 254.086402553848 254.088370380771 0.999992255344389 1.00000774471559 -0.0523598775598291 0.0523598775599049 -0.0523598775598297
|
||||
358 -0.034899496702501 0.9993908270191 -0.034920769491748 -28.636253282916 6.2482787221397 258.560006912742 258.561940692587 0.999992521018985 1.00000747903695 -0.0349065850398866 0.0349065850397648 -0.0349065850398869
|
||||
359 -0.017452406437284 0.99984769515639 -0.017455064928218 -57.289961630759 6.26573201465964 263.112375153174 263.11427547502 0.999992777579847 1.00000722247232 -0.0174532925199438 0.0174532925200115 -0.0174532925199437
|
|
Reference in New Issue
Block a user