当前位置: 首页 > news >正文

武汉哪里做网站网站在线优化工具

武汉哪里做网站,网站在线优化工具,网站建设与准备,餐饮 公司 网站建设一:点乘介绍 1. 向量点乘: 2. 向量点乘的性质: 3. 向量点乘公式: 4. 向量的点乘的属性: (1):向量与自身做点乘,会得到向量长度的平方: (2&#xf…

一:点乘介绍

        1. 向量点乘:

        

        2. 向量点乘的性质:

        

       3. 向量点乘公式:

        

        

        

      4. 向量的点乘的属性:

        (1):向量与自身做点乘,会得到向量长度的平方:

        (2):向量长度,为向量与自身点乘后再求平方根:

        (3):向量投影,将a向量投影到向量b上:

        (4):向量夹角:

二:叉乘介绍:

        1. 向量叉乘:

           

        2. 向量叉乘公式:

         

        3. 向量叉乘的属性:

                判断三个向量是否共面:

三:应用1 - 求两直线的交点:

        (1)2D直线方程:

        (2)将直线1带入直线2中:  ,叉乘等于0,意味着两向量共线。

        (3)求交点:

                

四:应用2 - 求三个平面的交点:

        (1):三个平面方程:

                

        (2):三个平面方程,三个未知数,利用克拉默法则求解即可。

三:实现

#ifndef _POINT_H_
#define _POINT_H_#include <iostream>
#include <cmath>class Point2D
{
public:float x, y;Point2D() {}Point2D(float x, float y) : x(x), y(y) {}Point2D &operator+=(const Point2D &t){x += t.x;y += t.y;return *this;}Point2D &operator-=(const Point2D &t){x -= t.x;y -= t.y;return *this;}Point2D &operator*=(float t){x *= t;y *= t;return *this;}Point2D &operator/=(float t){x /= t;y /= t;return *this;}Point2D operator+(const Point2D &t) const{return Point2D(*this) += t;}Point2D operator-(const Point2D &t) const{return Point2D(*this) -= t;}Point2D operator*(float t) const{return Point2D(*this) *= t;}Point2D operator/(float t) const{return Point2D(*this) /= t;}float dot(const Point2D& b) const{return x * b.x + y * b.y;}friend std::ostream &operator<<(std::ostream &out, const Point2D &t){out << '(' << t.x << ',' << t.y << ')';return out;}};Point2D operator*(float a, const Point2D &b)
{return b * a;
}float dot(const Point2D& a, const Point2D& b)
{return a.dot(b);
}float norm(const Point2D& a)
{return dot(a, a);
}double abs(const Point2D& a) {return sqrt(norm(a));
}double proj(const Point2D& a, const Point2D& b)
{return dot(a, b) / abs(b);
}double angle(const Point2D& a, const Point2D& b)
{return acos(dot(a, b) / abs(a) / abs(b));
}float cross(const Point2D& a, const Point2D& b)
{return a.x * b.y - a.y * b.x;
}Point2D intersect(const Point2D& a1, const Point2D& d1, const Point2D& a2, const Point2D& d2)
{return a1 + cross(a2 - a1, d2) / cross(d1, d2) * d1;
}class Point3D: public Point2D
{
public:float z;Point3D() {}Point3D(float x, float y, float z) : Point2D(x, y), z(z) {}Point3D &operator+=(const Point3D &t){x += t.x;y += t.y;z += t.z;return *this;}Point3D &operator-=(const Point3D &t){x -= t.x;y -= t.y;z -= t.z;return *this;}Point3D &operator*=(float t){x *= t;y *= t;z *= t;return *this;}Point3D &operator/=(float t){x /= t;y /= t;z /= t;return *this;}Point3D operator+(const Point3D &t) const{return Point3D(*this) += t;}Point3D operator-(const Point3D &t) const{return Point3D(*this) -= t;}Point3D operator*(float t) const{return Point3D(*this) *= t;}Point3D operator/(float t) const{return Point3D(*this) /= t;}float dot(const Point3D &t) const{return x * t.x + y * t.y + z * t.z;}friend std::ostream &operator<<(std::ostream &out, const Point3D &t){out << '(' << t.x << ',' << t.y << ',' << t.z << ')';return out;}
};Point3D operator*(float a, Point3D b)
{return b * a;
}float dot(const Point3D& a, const Point3D& b) 
{return a.dot(b);
}float norm(const Point3D& a) 
{return dot(a, a);
}double abs(const Point3D& a) {return sqrt(norm(a));
}double proj(const Point3D& a, const Point3D& b)
{return dot(a, b) / abs(b);
}double angle(const Point3D& a, const Point3D& b)
{return acos(dot(a, b) / abs(a) / abs(b));
}Point3D cross(const Point3D& a, const Point3D& b)
{return Point3D(a.y * b.z - a.z * b.y,a.z * b.x - a.x * b.z,a.x * b.y - a.y * b.x);
}float triple(const Point3D& a, const Point3D& b, const Point3D& c) 
{return dot(a, cross(b, c));
}Point3D intersect(const Point3D& a1, const Point3D& n1, const Point3D& a2, const Point3D& n2, const Point3D& a3, const Point3D& n3) 
{Point3D x(n1.x, n2.x, n3.x);Point3D y(n1.y, n2.y, n3.y);Point3D z(n1.z, n2.z, n3.z);Point3D d(dot(a1, n1), dot(a2, n2), dot(a3, n3));return Point3D(triple(d, y, z),triple(x, d, z),triple(x, y, d)) / triple(n1, n2, n3);
}#endif

http://www.khdw.cn/news/64108.html

相关文章:

  • 网站备案帐号找回刷关键词排名软件有用吗
  • 阿里巴巴上做英文网站一年多少钱自动秒收录网
  • 学校网站建设与管理站长之家查询的网址
  • 中山精品网站建设案例2023必考十大时政热点
  • wordpress开发登录插件seo整站网站推广优化排名
  • 汕头网站推广公司seo有哪些优化工具
  • 盐城市纪检委网站开发区2024年新闻摘抄十条
  • 重庆网站站长统计 网站统计
  • wordpress 淘宝客apiseo搜索引擎优化排名哪家更专业
  • 适合女人的小型加工厂新seo排名点击软件
  • 做电商网站的宁波网站建设团队
  • 软件开发专业都学什么汤阴县seo快速排名有哪家好
  • 网站后台用什么语言在线超级外链工具
  • 申请域名费用太原seo关键词排名
  • 有了域名怎么做自己得网站百度seo技术优化
  • 如何做音乐分享类网站sq网站推广
  • 旅游网站建设规划书模板下载做引流推广的平台600
  • 在家给别人做网站合法吗今日头条新闻最新疫情
  • 做暧暧网站在线观看南京seo排名收费
  • 贵阳网站制作费用整合营销的最高阶段是
  • 聊天网站怎么建设百度搜图入口
  • 顺德企业手机网站建设百度推广销售员的工作内容
  • 什么网站可以有人做详情页网站域名解析ip
  • 日本网站云服务器费用教育培训网站大全
  • 自媒体网站建设论文百度网站官网
  • 商丘做网站需要多少钱ios aso优化工具
  • 网站开发客户需求引流软件
  • 做网站为什么要投资钱seo排名策略
  • 时间线wordpress主题零基础学seo要多久
  • 企业网站做的好山东网站seo推广优化价格