Skip to content

Commit 488be65

Browse files
authored
Add files via upload
0 parents  commit 488be65

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

abc.ino

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
double x1=0, y1=1, x2=3, y2=7, x3=-1, y3=7; // y=2x^{2}-4x+1
2+
3+
void setup() {
4+
Serial.begin(9600);
5+
double a, b, c;
6+
7+
a = (x1*(y3-y2) + x2*(y1-y3) + x3*(y2-y1))/((x1-x2)*(x1-x3)*(x2-x3));
8+
b = (y2-y1)/(x2-x1) - a*(x1+x2);
9+
c = y1 - a*x1*x1 - b*x1;
10+
11+
Serial.print("a = ");
12+
Serial.println(a,5);
13+
Serial.print("b = ");
14+
Serial.println(b,5);
15+
Serial.print("c = ");
16+
Serial.println(c,5);
17+
18+
}
19+
20+
void loop() {
21+
22+
}

0 commit comments

Comments
 (0)