function CrossPoint( ) %% 求两条直线的交点坐标 x1 = [7.8 8]; y1 = [0.96 0.94]; %line2 x2 = [8.25 8.25]; y2 = [0 0.99]; %fit linear polynomial p1 = polyfit(x1,y1,1); p2 = polyfit(x2,y2,1); %calculate intersection x_intersect = fzero(@(x) polyval(p1-p2,x),3); y_…
http://poj.org/problem?id=3304 给你几条线段  然后 让你找到一条直线让他在这条直线上的映射有一个重合点 如果有这条直线的话  这个重合的部分的两个端点一定是某两条线段的端点 所以只需要枚举每个点连成的直线能不能跟所有的线段相交就行了 #include<stdio.h> #include<string.h> #include<stdlib.h> #include<ctype.h> #include<math.h> #…
Segments Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 10921   Accepted: 3422 Description Given n segments in the two dimensional space, write a program, which determines if there exists a line such that after projecting these segments…
闲话不说,直接上代码与图的效果!…
MATLAB求马氏距离(Mahalanobis distance) 作者:凯鲁嘎吉 - 博客园 http://www.cnblogs.com/kailugaji/ 1.马氏距离计算公式 d2(xi, xj)=(xi-xj)TS-1(xi-xj) 其中,S是总体的协方差矩阵,而不是样本的协方差矩阵. 2.matlab中现有的函数 >> x=[155 66;180 71;190 73;160 60;190 68;150 58;170 75] x = 155 66 180 71 190 73 160…
Pipe Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 8280   Accepted: 2483 Description The GX Light Pipeline Company started to prepare bent pipes for the new transgalactic light pipeline. During the design phase of the new pipe shape th…
Mirror and Light Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 650    Accepted Submission(s): 316 Problem Description The light travels in a straight line and always goes in the minimal path b…
POJ_1269_Intersecting Lines_求直线交点 Description We all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three ways: 1) no intersection because they are parallel, 2) intersect in…
题目:http://poj.org/problem?id=1269 相关知识: 叉积求面积:https://www.cnblogs.com/xiexinxinlove/p/3708147.html什么是叉积:https://blog.csdn.net/sunbobosun56801/article/details/78980467        其二维:https://blog.csdn.net/qq_38182397/article/details/80508303计算交点:    方法1:面…
Problem ATriangle Fun Input: Standard Input Output: Standard Output In the picture below you can see a triangle ABC. Point D, E and F divides the sides BC, CA and AB into ratio 1:2 respectively. That is CD=2BD, AE=2CE and BF=2AF. A, D; B, E and C, F…