几何学

1、余弦定理

如下图所示,在△ABC中,余弦定理可表示为:

余弦定理的三个证明

转自:http://www.matrix67.com/blog/archives/2324

证明1:


证明2:


证明三



2、正弦定理

在任意△ABC中,角A、B、C所对的边长分别为a、b、c,三角形外接圆的半径为R

则有


公式变形

△ABC中,若角A,B,C所对的边为a,b,c,三角形外接圆半径为R,直径为D,正弦定理进行变形有





三角形面积公式:


外接圆半径公式:


定理证明

前三项的证明

利用三角形的高证明

当△ABC是锐角三角形时,设边 AB 上的高是 CD ,CD = a * sinB,CD = b * sinA

由此,得 ,同理可得

故有

当△ABC是钝角三角形时,过点 C 做 AB 边上的高,交 AB 的延长线于点 D,CD = a * sin∠CBD = a * sin∠ABC ,CD = b * sinA


由此,得,同理可得

故有

外接圆证明正弦定理


在△ABC中,已知 BC = a,AC = b,AB = c,做三角形 ABC 的外接圆,O 为圆心

连接 BO并延长交圆于 B' ,BB' = 2 * R

根据直径所对的的圆周角是直角以及同弧所对的圆周角相等可以得到 ∠BAB' = 90°,∠C = ∠B',

所以

同理可得

所以


HDU 1374 The Circumference of the Circle

题意:

给出三角形三个顶点的坐标,求外接圆的周长


解题思路:

p = (a + b + c) / 2.0

S = sqrt(p * (p - a) * (p - b) * (p - c))

外接圆直径 D = (a * b * c) / (2.0 * S)

周长 = PI * D

#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <vector>
#include <stack>
#include <map>
#include <cmath>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;

const int mod = 1e9 + 7;
const int INF = 0x7fffffff;
const double PI = 3.141592653589793;

double dis(double x1, double y1, double x2, double y2);

int main()
{
#ifdef __AiR_H
    freopen("in.txt", "r", stdin);
#endif // __AiR_H
    double x1, y1, x2, y2, x3, y3;
    while (scanf("%lf%lf%lf%lf%lf%lf", &x1, &y1, &x2, &y2, &x3, &y3) != EOF) {
        double a = dis(x2, y2, x3, y3), b = dis(x1, y1, x3, y3), c = dis(x1, y1, x2, y2);
        double p = (a + b + c) / 2.0;
        double S = sqrt(p * (p - a) * (p - b) * (p - c));
        double D = (a * b * c) / (2.0 * S);
        double ans = D * PI;
        printf("%.2f\n", ans);
    }
    return 0;
}

double dis(double x1, double y1, double x2, double y2)
{
    return (sqrt((x2-x1) * (x2-x1) + (y2-y1) * (y2-y1)));
}


CodeForces_1C Ancient Berland Circus

参考:http://blog.csdn.net/aholic/article/details/21733777

题意:

给出正多边形上的三个点的坐标,,求这个正多边形的最小的面积


解题思路:

由于是确定是正多边形,所以一定存在外接圆

所以可以分为如下几步:
海伦公式求面积:

p = (a+b+c) / 2.0     

S = sqrt(p * (p - a) * (p - b) * (p - c))

1.求外接圆半径r = abc / 4S
2.由余弦定理求出三个圆心角
(要注意的是,有可能有三个点在同一段半圆弧上,这是第三个圆心角应该用2π - ang1 - ang2, 所以干脆全部都是 ang3 = 2π - ang1 - ang2)
3.求这三个角的最大公约数为 gcd, 那么这就是一个 n = 2π / gcd 的正 n 边形
4.一个小三角形的面积S = 1/2·r * r * sin(gcd)
5.nS即为所求


#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <vector>
#include <stack>
#include <map>
#include <cmath>
#include <cctype>

using namespace std;

#define PI acos(-1.0)

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;

const double eps = 1e-2;
const int mod = 1e9 + 7;
const int INF = 0x7fffffff;

double dis(double x1, double y1, double x2, double y2);
double fgcd(double a, double b);

int main()
{
#ifdef __AiR_H
    freopen("in.txt", "r", stdin);
#endif // __AiR_H
    double a_x, a_y, b_x, b_y, c_x, c_y;
    scanf("%lf%lf%lf%lf%lf%lf", &a_x, &a_y, &b_x, &b_y, &c_x, &c_y);
    double a = dis(b_x, b_y, c_x, c_y), b = dis(a_x, a_y, c_x, c_y), c = dis(a_x, a_y, b_x, b_y);
    double p = (a + b + c) / 2.0;
    double S = sqrt(p * (p-a) * (p-b) * (p-c));
    double r = a * b * c / (4.0 * S);
    double Angle_a , Angle_b, Angle_c;
    Angle_a = acos(1.0 - a*a / (2.0 * r * r));
    Angle_b = acos(1.0 - b*b / (2.0 * r * r));
    Angle_c = 2.0 * PI - Angle_a - Angle_b;
    double Angle_gcd = 0;
    Angle_gcd = fgcd(0, Angle_a);
    Angle_gcd = fgcd(Angle_gcd, Angle_b);
    Angle_gcd = fgcd(Angle_gcd, Angle_c);
    printf("%.6f\n", r * r * sin(Angle_gcd) * PI / Angle_gcd);
    return 0;
}

double dis(double x1, double y1, double x2, double y2)
{
    return sqrt((x2 - x1) * (x2 - x1) + (y2- y1) * (y2 -y1));
}

double fgcd(double a, double b)
{
    if (fabs(a) < eps) {
        return b;
    }
    if (fabs(b) < eps) {
        return a;
    }
    return fgcd(b, fmod(a, b));
}


三、

内心:内角平分线的交点

旁心:外角平分线的交点

外心:垂直平分线的交点

垂心:高的交点

重心:各边中线的交点









  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值