计算几何
爱上键盘的小哥哥
这个作者很懒,什么都没留下…
展开
-
A - TOYS (点与线段的位置关系 )
Calculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - their child John never puts his toys away when he is f...原创 2018-02-26 15:58:18 · 202 阅读 · 0 评论 -
Beauty Contest POJ - 2187 (GrahamScan算法求解凸包)
Bessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning the title 'Miss Cow World'. As a result, Bessie will make a tour of N (2 <= N <= 50,000) farms aroun...原创 2018-08-02 20:25:03 · 163 阅读 · 0 评论 -
求解任意多边形面积
给出n个点在直角坐标系下的坐标(x,y),求解由n个点构成多边形的面积通常求解多边形的面积会转化为求解n-2个三角形面积和但是这样免不了繁琐的算法,编程复杂度和时间复杂度都很差。根据矢量叉乘的几何意义 矢量A与矢量B的矢量积是一个矢量,其模等于由A和B作成的平行四边形的面积,下面给出一个公式。要先将点按逆时针顺序排序极点排序#include<cstdio>#inc...原创 2018-08-02 14:55:49 · 964 阅读 · 0 评论 -
极角排序详解
一.相关定义在平面内取一个定点O,叫极点,引一条射线Ox,叫做极轴,再选定一个长度单位和角度的正方向(通常取逆时针方向)。对于平面内任何一点M,用ρ表示线段OM的长度(有时也用r表示),θ表示从Ox到OM的角度,ρ叫做点M的极径,θ叫做点M的极角,有序数对 (ρ,θ)就叫点M的极坐标,这样建立的坐标系叫做极坐标系。在通常情况下,我们需要将这些点按照一个选定的中心顺(逆)时针排序。二.排...原创 2018-08-02 14:47:48 · 1730 阅读 · 0 评论 -
Triangle (旋转卡壳求最大三角形面积)
Given n distinct points on a plane, your task is to find the triangle that have the maximum area, whose vertices are from the given points.InputThe input consists of several test cases. The first ...原创 2018-08-05 13:16:11 · 680 阅读 · 0 评论 -
求三角形【内心,外心,重心,垂心】
三角形的重心,外心,垂心,内心和旁心称之为三角形的五心。三角形五心定理是指三角形重心定理,外心定理,垂心定理,内心定理,旁心定理的总称,本文主要根据五心的性质求三角形的五心。设三角形为ABC, a=BC, b=CA, c=AB先准备一下需要的变量和函数struct Point{ double x,y; Point(){ } Point(double xx,double y...原创 2018-08-09 11:09:40 · 31008 阅读 · 3 评论 -
Beauty Contest (求解凸包+旋转卡壳求直径)
经过一番挣扎,WNJXYK还是成功逃脱了,他来到了学校的后花园,后花园里有N个草堆 (2 <= N <= 50,000) ,每个草堆用(x,y)的坐标来表示(-10,000 <=x,y<= 10,000),当然两个草堆不可能在同一个坐标。WNJXYK决定躲在其中一个草堆里。吸取了上题翻车的经验,WNJXYK决定先计算一下自己的躲法安不安全,于是他想知道这些草垛之间,距离...原创 2018-08-03 18:43:15 · 214 阅读 · 0 评论 -
Summer holiday (求解凸包)
Summer holiday was coming! Xiaomao went back to his hometown where he yearn day and night, his hometown has picturesque scenery. There is a big forest beside his village. There are n trees in the fore...原创 2018-08-03 18:14:30 · 293 阅读 · 0 评论 -
Light Bulb ZOJ - 3203
Compared to wildleopard's wealthiness, his brother mildleopard is rather poor. His house is narrow and he has only one light bulb in his house. Every night, he is wandering in his incommodious house,...原创 2018-04-20 18:34:34 · 151 阅读 · 0 评论 -
Common Tangents FZU - 2213
Two different circles can have at most four common tangents. The picture below is an illustration of two circles with four common tangents. Now given the center and radius of two circles, your jo...原创 2018-04-15 16:50:08 · 142 阅读 · 0 评论 -
Forever 0.5 FZU - 2140 (判断凸四边形)
Given an integer N, your task is to judge whether there exist N points in the plane such that satisfy the following conditions: 1. The distance between any two points is no greater than 1.0. 2. The d...原创 2018-04-14 20:10:39 · 1081 阅读 · 1 评论 -
Constellation (叉乘积)
Cat Noku has obtained a map of the night sky. On this map, he found a constellation with n stars numbered from 1 to n. For each i, the i-th star is located at coordinates (xi, yi). No two stars are l...原创 2018-03-30 18:43:08 · 678 阅读 · 0 评论 -
Nearest vectors CodeForces - 598C
You are given the set of vectors on the plane, each of them starting at the origin. Your task is to find a pair of vectors with the minimal non-oriented angle between them. Non-oriented angle is non-...原创 2018-03-20 16:57:26 · 206 阅读 · 0 评论 -
Toy Storage POJ - 2398
Mom and dad have a problem: their child, Reza, never puts his toys away when he is finished playing with them. They gave Reza a rectangular box to put his toys in. Unfortunately, Reza is ...原创 2018-03-01 12:00:42 · 140 阅读 · 0 评论 -
Scrambled Polygon POJ - 2007 (极角排序)
A closed polygon is a figure bounded by a finite number of line segments. The intersections of the bounding line segments are called the vertices of the polygon. When one starts at any vertex of a clo...原创 2018-08-02 21:50:13 · 175 阅读 · 0 评论