A set of points on a plain surface that forms a curve such that any point on that curve is equidistant from a point in the center (called focus) is a parabola.
The general equation for the parabola is
y = ax2 + bx + c
登录后复制
The vertex of a parabola is the coordinate from which it takes the sharpest turn whereas a is the straight-line used to generate the curve.
Focus is the point with is equidistant from all points of the parabola.
立即学习“C++免费学习笔记(深入)”;
Here, we will find the vertex, focus, and directrix of a parabola. There is a mathematical formula that finds all these values. And we will make a program using the mathematical formula for it.
Input:a = 10,b = 5,c = 4Output:The vertex: (-0.25, 3.375)The Focus: (-0.25, 3.4)y-Directrix:-1036
登录后复制
解释
根据给定的抛物线图形的数值,找到顶点、焦点和y方向的数学公式。
顶点 = {(-b/2a) , (4ac-b2/4a)}
焦点 = {(-b/2a), (4ac-b2+1/4a)}
方向 = c – (b2 +1)*4a
示例
#include using namespace std;int main() { float a = 10, b = 5, c = 4; cout
登录后复制
以上就是寻找抛物线的顶点、焦点和准线的C/C++程序的详细内容,更多请关注【创想鸟】其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。
发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/2583613.html