Parabola Coordinates Program
A program that finds coordinates to a parabola.
AI
KI-Zusammenfassung: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Quellcode
#include <stdio.h>
#include <iostream.h>
#include <math.h>
int main()
{
double a, b, c, x1, x2, vp, z;
printf("Please enter a, b, and c of your quadratic equation (in that order): ");
cin >> a;
cin >> b;
cin >> c;
x1 = (-b + sqrt(b*b - 4*a*c))/(2*a); //First x-intercept
x2 = (-b - sqrt(b*b - 4*a*c))/(2*a); //Second x-intercept
z = -b/(2*a);
vp = (a*z)*(a*z) + (b*z) + c; //Vertex point
printf("The x-intercepts are %lg and %lg\n", x1, x2);
printf("The y-intercept is %lg\n", c);
printf("The vertex point is %lg , %lg\n", z, vp);
return 0;
}
Originalkommentare (3)
Wiederhergestellt von der Wayback Machine