直线与椭圆相交求交点
来源:互联网 发布:淘宝店铺能不能注销 编辑:程序博客网 时间:2024/05/05 19:20
引自……CSDN
已知a,b和直线上的两点,中心在原点,求直线与椭圆相交求交点坐标
#include<stdio.h>#include<conio.h>#include<math.h>void main(){ double a,b,c,x1,x2,y1,y2,k,j; printf("\nplease input a,b:\n"); scanf("%lf%lf",&a,&b); printf("\nplease input x1,y1,x2,y2\n"); scanf("%lf%lf%lf%lf",&x1,&y1,&x2,&y2); k=(y1-y2)/(x1-x2); c=y1-k*x1; j=(2*a*a*k*c)*(2*a*a*k*c)-4*(b*b+a*a*k*k)*a*a*(c*c-b*b); if(j<0) printf("\nthe line don't intersect with the ellipse"); else if(j==0) { x1=-2*k*c*a*a/(2*(b*b+a*a*k*k)); y1=k*x1+c; printf("\nthe line and ellipse intersect at\n(%lf,%lf)",x1,y1); } else { x1=(-2*k*c*a*a+sqrt(j))/(2*(b*b+a*a*k*k)); y1=k*x1+c; x2=(-2*k*c*a*a-sqrt(j))/(2*(b*b+a*a*k*k)); y2=k*x2+c; printf("\nthe line and ellipse intersect at\n(%lf,%lf) and (%lf,%lf)",x1,y1,x2,y2); } getch();}
- 直线与椭圆相交求交点
- poj 1269 知识点:直线相交判断,求相交交点
- Intersecting Lines(直线相交判断,求相交交点)
- poj 1269 Intersecting Lines(判断直线相交 求交点)
- 判断两条线段/直线相交,并求交点
- poj 1269 判断直线相交,并求交点
- 判断两条线段/直线相交,并求交点
- poj1269Intersecting Lines【直线相交平行共线的判断+求交点】
- POJ2074Line of Sight【直线相交判定+求交点】
- POJ 1269 Intersecting Lines(直线相交判断,求交点)
- POJ 1269 Intersecting Lines(直线相交判断,求交点)
- 两直线四坐标点判断相交并求交点
- 一般方程与参数方程求直线交点
- 求空间直线与平面的交点
- 求直线与平面的交点
- poj 2074 Line of Sight(视线问题,求直线与线段的交点及判断相交)
- POj 1039 直线与线段相交 直线与直线的交点
- 求直线(线段)与直线(线段)的交点
- ADO.NET WinForm 编程案例(一)
- python 编码
- android 自定义view 不执行 ondraw的解决办法
- 【二分】hdu 4004
- ubuntu下编译openJdk - 6
- 直线与椭圆相交求交点
- <转载>字符编码简介:ASCII,Unicode,UTF-8,GB2312
- Ogre中的贴花
- Ogre字体code_points生成工具
- 判断两个字符串是否是anagram
- java接口用法:向上转型和回调函数
- 分层打印二叉树 [N0. 20]
- 我的伪ACM之路(省赛二)
- Java Serialization 序列化