# benetech/Inactive-Math-Description-Engine

Switch branches/tags
Nothing to show
Fetching contributors…
Cannot retrieve contributors at this time
47 lines (30 sloc) 1.48 KB
 Equations to be Identified y=... A*sin(x...) + D sin(x...)/A + D (1/A) Solve the problem by adding a check between the ampersands for a A` so we can look for (A/78787)*sin(B*C)&/d& + D . Coefficient part one \* connects the coefficient sin\(([^)\n]*)\) --sin and the middle gets us B and C --second part after sin It could be possible that we could try a different framework and reverse engineer the graph itself to get the features public static void main(String[] args){ //TODO USE EXPRESSION THE EVALUATE A AND D String getCoeff = "y=(-?\\d*[\\./]?\\d*)\\*sin\\([^)\\n]*\\)([\\+-]\\d*[\\./]?\\d*)?"; //String insideSIN = "sin\\(([^)\\n]*)\\)"; //String getOffset = "sin\\([^)\\n]*\\)([\\+\\-]\\d*[\\./]?\\d*)"; //String all = "(-?\\d*[\\./]?\\d*)\\*sin\\(([^)\\n]*)\\)"; String[] test = {"y= sin( x)","y=-sin(4 * x)", "y= sin (x)", "y=-3 * sin(4*x+20)", "y=-4.3*sin(4*x+432)+9"," y=5 /3 * sin( x/3)-4"}; for(int i= 0; i