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

常用的三角函数公式




  • sin ⁡ 2 x + cos ⁡ 2 x = 1 \sin ^2 x + \cos ^2 x = 1 sin2x+cos2x=1

  • tan ⁡ x = sin ⁡ x cos ⁡ x \tan x = \dfrac{\sin x}{\cos x} tanx=cosxsinx

  • cot ⁡ x = 1 tan ⁡ x = cos ⁡ x sin ⁡ x \cot x = \dfrac{1}{\tan x}=\dfrac{\cos x}{\sin x} cotx=tanx1=sinxcosx

  • sec ⁡ x = 1 cos ⁡ x \sec x= \dfrac{1}{\cos x} secx=cosx1

  • csc ⁡ x = 1 sin ⁡ x \csc x =\dfrac{1}{\sin x} cscx=sinx1

  • tan ⁡ 2 x = sec ⁡ 2 − 1 = 1 cos ⁡ 2 x − 1 = 1 − cos ⁡ 2 x cos ⁡ 2 x = sin ⁡ 2 x cos ⁡ 2 x \tan^2x=\sec^2-1=\dfrac{1}{\cos^2x}-1=\dfrac{1-\cos^2x}{\cos^2x}=\dfrac{\sin^2x}{\cos^2x} tan2x=sec21=cos2x11=cos2x1cos2x=cos2xsin2x

  • cot ⁡ 2 = csc ⁡ 2 x − 1 = 1 sin ⁡ 2 x − 1 = 1 − sin ⁡ 2 x sin ⁡ 2 x = cos ⁡ 2 x sin ⁡ 2 x \cot^2=\csc^2x-1=\dfrac{1}{\sin^2x}-1=\dfrac{1-\sin^2x}{\sin^2x}=\dfrac{\cos^2x}{\sin^2x} cot2=csc2x1=sin2x11=sin2x1sin2x=sin2xcos2x

  • cos ⁡ x = sin ⁡ ( x + π 2 ) \cos x=\sin(x+\dfrac{\pi}{2}) cosx=sin(x+2π) sin ⁡ x \sin x sinx 向左平移 π 2 \dfrac{\pi}{2} 2π. (左加右减)

  • sin ⁡ x = cos ⁡ ( x − π 2 ) \sin x=\cos(x-\dfrac{\pi}{2}) sinx=cos(x2π)

  • cos ⁡ x = cos ⁡ ( − x ) \cos x= \cos(-x) cosx=cos(x),偶函数

  • sin ⁡ x = − sin ⁡ ( − x ) \sin x = - \sin(-x) sinx=sin(x),奇函数

  • sin ⁡ x = − sin ⁡ ( x ± π ) \sin x= -\sin(x\pm\pi) sinx=sin(x±π) sin ⁡ x \sin x sinx无论是向左、还是向右平移 π \pi π 个单位后,乘以-1,关于x轴对称之后函数图像不变.

  • cos ⁡ x = − cos ⁡ ( x ± π ) \cos x = -\cos(x\pm\pi) cosx=cos(x±π)

  • arcsin ⁡ x + arccos ⁡ x = π 2 \arcsin x+\arccos x=\dfrac{\pi}{2} arcsinx+arccosx=2π.


倍(半)角公式

  • cos ⁡ ( A ± B ) = cos ⁡ A ⋅ cos ⁡ B ∓ sin ⁡ A ⋅ sin ⁡ B \cos(A\pm B)=\cos A\cdot\cos B \mp \sin A\cdot\sin B cos(A±B)=cosAcosBsinAsinB.

  • sin ⁡ ( A ± B ) = sin ⁡ A ⋅ cos ⁡ B ± cos ⁡ A ⋅ sin ⁡ B \sin(A\pm B)=\sin A\cdot\cos B \pm \cos A\cdot\sin B sin(A±B)=sinAcosB±cosAsinB.

  • cos ⁡ ( 2 A ) = cos ⁡ 2 A − sin ⁡ 2 A = 1 − 2 sin ⁡ 2 A = 2 cos ⁡ 2 A − 1 \cos(2A)=\cos^2A-\sin^2A=1-2\sin^2A=2\cos^2A-1 cos(2A)=cos2Asin2A=12sin2A=2cos2A1.

  • cos ⁡ A = cos ⁡ 2 A 2 − sin ⁡ 2 A 2 = 1 − 2 sin ⁡ 2 A 2 = 2 cos ⁡ 2 A 2 − 1 \cos A = \cos^2\dfrac{A}{2}-\sin^2\dfrac{A}{2}=1-2\sin^2\dfrac{A}{2}=2\cos^2\dfrac{A}{2}-1 cosA=cos22Asin22A=12sin22A=2cos22A1.

  • sin ⁡ ( 2 A ) = 2 sin ⁡ A ⋅ cos ⁡ A \sin(2A)=2\sin A\cdot\cos A sin(2A)=2sinAcosA.

  • sin ⁡ A = 2 sin ⁡ A 2 ⋅ cos ⁡ A 2 \sin A = 2\sin\dfrac{A}{2}\cdot\cos\dfrac{A}{2} sinA=2sin2Acos2A.


  • tan ⁡ 2 α = 2 tan ⁡ α 1 − tan ⁡ 2 α \tan2\alpha=\dfrac{2\tan\alpha}{1-\tan^2\alpha} tan2α=1tan2α2tanα.

  • tan ⁡ α = 2 tan ⁡ α 2 1 − tan ⁡ 2 α 2 \tan\alpha=\dfrac{2\tan\dfrac{\alpha}{2}}{1-\tan^2\dfrac{\alpha}{2}} tanα=1tan22α2tan2α.

  • tan ⁡ α 2 = 1 − cos ⁡ α sin ⁡ α = sin ⁡ α 1 + cos ⁡ α \tan\dfrac{\alpha}{2}=\dfrac{1-\cos\alpha}{\sin\alpha}=\dfrac{\sin\alpha}{1+\cos\alpha} tan2α=sinα1cosα=1+cosαsinα.

tan ⁡ 2 α = sin ⁡ 2 α cos ⁡ 2 α = 2 sin ⁡ α ⋅ cos ⁡ α 1 − 2 sin ⁡ 2 α = 2 tan ⁡ α 1 cos ⁡ 2 α − 2 tan ⁡ 2 α = 2 tan ⁡ α 1 − sin ⁡ 2 α cos ⁡ 2 α − tan ⁡ 2 α = 2 tan ⁡ α 1 − tan ⁡ 2 α . \tan2\alpha=\dfrac{\sin2\alpha}{\cos2\alpha}=\dfrac{2\sin\alpha\cdot\cos\alpha}{1-2\sin^2\alpha}=\dfrac{2\tan\alpha}{\dfrac{1}{\cos^2\alpha}-2\tan^2\alpha}=\dfrac{2\tan\alpha}{\dfrac{1-\sin^2\alpha}{\cos^2\alpha}-\tan^2\alpha}=\dfrac{2\tan\alpha}{1-\tan^2\alpha}. tan2α=cos2αsin2α=12sin2α2sinαcosα=cos2α12tan2α2tanα=cos2α1sin2αtan2α2tanα=1tan2α2tanα.

tan ⁡ α = 2 tan ⁡ α 2 1 − tan ⁡ 2 α 2 \tan\alpha=\dfrac{2\tan\dfrac{\alpha}{2}}{1-\tan^2\dfrac{\alpha}{2}} tanα=1tan22α2tan2α
tan ⁡ α − tan ⁡ α tan ⁡ 2 α 2 = 2 tan ⁡ α 2 \tan\alpha-\tan\alpha\tan^2\dfrac{\alpha}{2}=2\tan\dfrac{\alpha}{2} tanαtanαtan22α=2tan2α
tan ⁡ α ⋅ tan ⁡ 2 α 2 + 2 tan ⁡ α 2 − tan ⁡ α = 0 \tan\alpha\cdot\tan^2\dfrac{\alpha}{2}+2\tan\dfrac{\alpha}{2}-\tan\alpha=0 tanαtan22α+2tan2αtanα=0
求根公式:
tan ⁡ α 2 = − 2 ± 4 + 4 tan ⁡ 2 α 2 tan ⁡ α = − 1 ± sec ⁡ α tan ⁡ α = − cos ⁡ α ± 1 sin ⁡ α \tan\dfrac{\alpha}{2}=\dfrac{-2\pm\sqrt{4+4\tan^2\alpha}}{2\tan\alpha}=\dfrac{-1\pm\sec\alpha}{\tan\alpha}=\dfrac{-\cos\alpha\pm1}{\sin\alpha} tan2α=2tanα2±4+4tan2α =tanα1±secα=sinαcosα±1
α ∈ ( 0 , π ) \alpha\in(0,\pi) α(0,π) 时, tan ⁡ α 2 > 0 \tan\dfrac{\alpha}{2}>0 tan2α>0,而 − cos ⁡ α + 1 sin ⁡ α < 0 -\dfrac{\cos\alpha+1}{\sin\alpha}<0 sinαcosα+1<0.

∴ tan ⁡ α 2 = − cos ⁡ α + 1 sin ⁡ α \therefore \tan\dfrac{\alpha}{2}=-\dfrac{\cos\alpha+1}{\sin\alpha} tan2α=sinαcosα+1 不成立.

∴ tan ⁡ α 2 = 1 − cos ⁡ α sin ⁡ α = ( 1 − cos ⁡ α ) ⋅ ( 1 + cos ⁡ α ) sin ⁡ α + sin ⁡ α ⋅ cos ⁡ α = 1 − cos ⁡ 2 α sin ⁡ α + sin ⁡ α ⋅ cos ⁡ α = sin ⁡ α 1 + cos ⁡ α \therefore \tan\dfrac{\alpha}{2}=\dfrac{1-\cos\alpha}{\sin\alpha}=\dfrac{(1-\cos\alpha)\cdot(1+\cos\alpha)}{\sin\alpha+\sin\alpha\cdot\cos\alpha}=\dfrac{1-\cos^2\alpha}{\sin\alpha+\sin\alpha\cdot\cos\alpha}=\dfrac{\sin\alpha}{1+\cos\alpha} tan2α=sinα1cosα=sinα+sinαcosα(1cosα)(1+cosα)=sinα+sinαcosα1cos2α=1+cosαsinα


正、余弦化切弦

  • sin ⁡ 2 x = 2 sin ⁡ x ⋅ cos ⁡ x = 2 tan ⁡ x sec ⁡ 2 x = 2 tan ⁡ x 1 + tan ⁡ 2 x \sin2x=2\sin x\cdot\cos x=\dfrac{2\tan x}{\sec^2x}=\dfrac{2\tan x}{1+\tan^2x} sin2x=2sinxcosx=sec2x2tanx=1+tan2x2tanx.

  • cos ⁡ 2 x = cos ⁡ 2 x − sin ⁡ 2 x = 1 − tan ⁡ 2 x sec ⁡ 2 x = 1 − tan ⁡ 2 x 1 + tan ⁡ 2 x \cos2x=\cos^2x-\sin^2x=\dfrac{1-\tan^2x}{\sec^2x}=\dfrac{1-\tan^2x}{1+\tan^2x} cos2x=cos2xsin2x=sec2x1tan2x=1+tan2x1tan2x.

  • sin ⁡ x = 2 tan ⁡ x 2 1 + tan ⁡ 2 x 2 \sin x=\dfrac{2\tan\dfrac{x}{2}}{1+\tan^2\dfrac{x}{2}} sinx=1+tan22x2tan2x.

  • cos ⁡ x = 1 − tan ⁡ 2 x 2 1 + tan ⁡ 2 x 2 \cos x=\dfrac{1-\tan^2\dfrac{x}{2}}{1+\tan^2\dfrac{x}{2}} cosx=1+tan22x1tan22x.


辅助角公式

  • sin ⁡ α ⋅ a a 2 + b 2 − cos ⁡ α ⋅ b a 2 + b 2 = sin ⁡ α ⋅ cos ⁡ β − cos ⁡ α ⋅ sin ⁡ β = sin ⁡ ( α − β ) \sin\alpha\cdot\dfrac{a}{\sqrt{a^2+b^2}}-\cos\alpha\cdot\dfrac{b}{\sqrt{a^2+b^2}}=\sin\alpha\cdot\cos\beta-\cos\alpha\cdot\sin\beta=\sin(\alpha-\beta) sinαa2+b2 acosαa2+b2 b=sinαcosβcosαsinβ=sin(αβ).

其中,令 cos ⁡ β = a a 2 + b 2 \cos\beta=\dfrac{a}{\sqrt{a^2+b^2}} cosβ=a2+b2 a sin ⁡ β = b a 2 + b 2 \sin\beta=\dfrac{b}{\sqrt{a^2+b^2}} sinβ=a2+b2 b

则有 cos ⁡ 2 β + sin ⁡ 2 β = ( a a 2 + b 2 ) 2 + ( b a 2 + b 2 ) 2 = 1 \cos^2\beta+\sin^2\beta=\Big(\dfrac{a}{\sqrt{a^2+b^2}}\Big)^2+\Big(\dfrac{b}{\sqrt{a^2+b^2}}\Big)^2=1 cos2β+sin2β=(a2+b2 a)2+(a2+b2 b)2=1.


E m L 2 ω 2 + R 2 ⋅ ( R ⋅ sin ⁡ ω t − L ω ⋅ cos ⁡ ω t ) \dfrac{E_m}{L^2\omega^2+R^2}\cdot\big(R\cdot\sin\omega t-L\omega\cdot\cos\omega t\big) L2ω2+R2Em(RsinωtLωcosωt)

= E m L 2 ω 2 + R 2 ⋅ ( sin ⁡ ω t ⋅ R L 2 ω 2 + R 2 − cos ⁡ ω t ⋅ L ω L 2 ω 2 + R 2 ) =\dfrac{E_m}{\sqrt{L^2\omega^2+R^2}}\cdot\big(\sin\omega t\cdot\dfrac{R}{\sqrt{L^2\omega^2+R^2}}-\cos\omega t\cdot\dfrac{L\omega}{\sqrt{L^2\omega^2+R^2}}\big) =L2ω2+R2 Em(sinωtL2ω2+R2 RcosωtL2ω2+R2 Lω)

= E m L 2 ω 2 + R 2 ⋅ sin ⁡ ( ω t − φ ) =\dfrac{E_m}{\sqrt{L^2\omega^2+R^2}}\cdot\sin(\omega t-\varphi) =L2ω2+R2 Emsin(ωtφ).

其中 cos ⁡ φ = R L 2 ω 2 + R 2 \cos\varphi=\dfrac{R}{\sqrt{L^2\omega^2+R^2}} cosφ=L2ω2+R2 R sin ⁡ φ = L ω L 2 ω 2 + R 2 \sin\varphi=\dfrac{L\omega}{\sqrt{L^2\omega^2+R^2}} sinφ=L2ω2+R2 Lω.


积化和差、和差化积

参考往期文章,点击跳转

相关文章:

常用的三角函数公式

sin ⁡ 2 x cos ⁡ 2 x 1 \sin ^2 x \cos ^2 x 1 sin2xcos2x1 tan ⁡ x sin ⁡ x cos ⁡ x \tan x \dfrac{\sin x}{\cos x} tanxcosxsinx​ cot ⁡ x 1 tan ⁡ x cos ⁡ x sin ⁡ x \cot x \dfrac{1}{\tan x}\dfrac{\cos x}{\sin x} cotxtanx1​sinxcosx​ sec …...

【MySQL】一文学会所有MySQL基础知识以及基本面试题

文章目录 前言 目录 文章目录 前言 一、主流数据库以及如何登陆数据库 二、常用命令使用 三、SQL分类 3.1 存储引擎 四、创建数据库如何设置编码等问题 4.1操纵数据库 4.2操纵表 五、数据类型 六、表的约束 七、基本查询 八、函数 九、复合查询 十、表的内连和外连 十一、索引…...

self.register_buffer方法使用解析(pytorch)

self.register_buffer就是pytorch框架用来保存不更新参数的方法。 列子如下&#xff1a; self.register_buffer("position_emb", torch.randn((5, 3)))第一个参数position_emb传入一个字符串&#xff0c;表示这组参数的名字&#xff0c;第二个就是tensor形式的参数…...

关于卷积神经网络中如何计算卷积核大小(kernels)

首先需要说明的一点是&#xff0c;虽然卷积层得名于卷积&#xff08; convolution &#xff09;运算&#xff0c;但我们通常在卷积层中使用更加直观的计算方式&#xff0c;叫做互相关&#xff08; cross-correlation &#xff09;运算。 也就是说&#xff0c;其实我们现在在这里…...

python使用selenium做自动化,最新版Chrome与chromedriver不兼容

目前Chrome版本是118.0.5993.118 下方是版本对应的下载地址&#xff1a; chrome版本118&#xff1a; https://download.csdn.net/download/qq_35845339/88510476 chrome版本119&#xff1a; chromedriverlinux64https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testin…...

算法进阶指南图论 通信线路

通信线路 思路&#xff1a;我们考虑需要升级的那条电缆的花费&#xff0c;若其花费为 w &#xff0c;那么从 1 到 n 的路径上&#xff0c;至多存在 k 条路径的价值大于 w &#xff0c;这具有一定的单调性&#xff0c;当花费 w 越大&#xff0c;我们路径上价值大于 w 的花费会越…...

【QEMU-tap-windows-Xshell】QEMU 创建 aarch64虚拟机(附有QEMU免费资源)

“从零开始&#xff1a;在Windows上创建aarch64&#xff08;ARM64&#xff09;虚拟机” 前言 aarch64&#xff08;ARM64&#xff09;架构是一种现代的、基于 ARM 技术的计算架构&#xff0c;具有诸多优点&#xff0c;如低功耗、高性能和广泛应用等。为了在 Windows 平台上体验…...

strtok函数详解:字符串【分割】的利器

目录 一&#xff0c;strtok函数简介 二&#xff0c;strtok函数的用法 三&#xff0c;strtok函数的注意事项 一&#xff0c;strtok函数简介 strtok函数可以帮助我们将一个字符串按照指定的分隔符进行分割&#xff0c;从而得到我们想要的子字符串。 &#x1f342;函数头文件&am…...

winui3开发笔记(二)自定义标题栏

参考文章链接&#xff1a;https://www.programminghunter.com/article/46392310600/ 注意事项 获取 AppWindowTitleBar 的实例并设置其颜色属性时&#xff0c;InitializeTitleBar(AppWindow.TitleBar);&#xff0c;只适用于Windows App SDK 1.2及以上&#xff0c;所以如果用w…...

MapReduce 读写数据库

MapReduce 读写数据库 经常听到小伙伴吐槽 MapReduce 计算的结果无法直接写入数据库&#xff0c; 实际上 MapReduce 是有操作数据库实现的 本案例代码将实现 MapReduce 数据库读写操作和将数据表中数据复制到另外一张数据表中 准备数据表 create database htu; use htu; creat…...

设计模式 -- 状态模式(State Pattern)

状态模式&#xff1a;类的行为基于它的状态改变 属于行为型模式&#xff0c;创建表示各种状态的对象和一个行为随着状态对象改变而改变的 context 对象。在代码中包含大量与对象状态有关的条件语句可以通过此模式将各种具体的状态类抽象出来 介绍 意图&#xff1a;允许对象在…...

qt quick发布程序启动失败

qt quick/qml 程序发布之后&#xff0c;程序启动不了 经过探究测试&#xff0c;程序启动的不了的情况下是因为有dll没有添加。在release文件夹下进行发布操作&#xff08;不单独复制xx.exe拿出来&#xff09;&#xff0c;再次点击IDE的RUN按钮&#xff0c;则会提示有Moudle没有…...

nginx反向代理报错合集

本文汇集了最近在使用nginx反向代理过程中遇到的一系列错误及其解决办法。 1缺乏支持项导致nginx配置错误 在利用sudo ./configure --with-http_ssl_module --with-http_stub_status_module进行配置时&#xff0c;往往会遇到以下类型的错误 error: the HTTP rewrite module …...

【Linux精讲系列】——vim详解

​作者主页 &#x1f4da;lovewold少个r博客主页 ⚠️本文重点&#xff1a;c入门第一个程序和基本知识讲解 &#x1f449;【C-C入门系列专栏】&#xff1a;博客文章专栏传送门 &#x1f604;每日一言&#xff1a;宁静是一片强大而治愈的神奇海洋&#xff01; 目录 目录 ​作者…...

微信小程序自动化采集方案

本文仅供学习交流&#xff0c;只提供关键思路不会给出完整代码&#xff0c;严禁用于非法用途&#xff0c;拒绝转载&#xff0c;若有侵权请联系我删除&#xff01; 一、引言 1、对于一些破解难度大&#xff0c;花费时间长的目标&#xff0c;我们可以先采用自动化点击触发请求&…...

操作系统第三章王道习题_内存管理_总结易错知识点

1. 静态重定位和动态重定位 静态重定位(可重定位装入):作业在装入内存的时候,就修改它的物理地址. 静态重定位进程数据一旦确定位置&#xff0c;就不能再移动 动态重定位(动态运行时装入):作业装入内存的时候,不修改物理地址,直到运行的时候,根据重定位寄存器再修改地址. 对…...

uniapp刻度尺的实现(swiper)滑动打分器

实现图&#xff08;百分制&#xff09;&#xff1a;滑动swiper进行打分&#xff0c;分数加减 <view class"scoring"><view class"toggle"><view class"score"><text>{{0}}</text><view class"scoreId&quo…...

cordova Xcode打包ios以及发布流程(ionic3适用)

第一步 1、申请iOS证书 2、导入证书到钥匙串 第二步 1、xcode配置iOS证书 1.1用Xcode打开你的项目&#xff08;我的Xcode版本是新版&#xff09; 修改如下图 回到基本信息设置界面&#xff0c;Bundie 这项填写&#xff0c;最先创建的那个appid&#xff0c;跟创建iOS描述文件时选…...

idea中的.idea文件夹以及*.iml文件(新版idea没有*.iml文件了),新旧版idea打开同一个项目会不会出现不兼容

一、背景 我们有可能会在同一台电脑上安装2个 intellj idea。比如一个community edition一个ultimate edition&#xff08;一个安装板一个绿色解压版&#xff09; 当然了&#xff0c;两个idea之间可能版本号也会有差。 这篇文章就来讨论两个问题&#xff0c;一是关于idea产生…...

高性能网络编程 - The C10K problem 以及 网络编程技术角度的解决思路

文章目录 C10KC10K的由来C10K问题在技术层面的典型体现C10K问题的本质C10K解决思路思路一&#xff1a;每个进程/线程处理一个连接思路二&#xff1a;每个进程/线程同时处理多个连接&#xff08;IO多路复用&#xff09;● 实现方式1&#xff1a;直接循环处理多个连接● 实现方式…...

视频字幕质量评估的大规模细粒度基准

大家读完觉得有帮助记得关注和点赞&#xff01;&#xff01;&#xff01; 摘要 视频字幕在文本到视频生成任务中起着至关重要的作用&#xff0c;因为它们的质量直接影响所生成视频的语义连贯性和视觉保真度。尽管大型视觉-语言模型&#xff08;VLMs&#xff09;在字幕生成方面…...

sqlserver 根据指定字符 解析拼接字符串

DECLARE LotNo NVARCHAR(50)A,B,C DECLARE xml XML ( SELECT <x> REPLACE(LotNo, ,, </x><x>) </x> ) DECLARE ErrorCode NVARCHAR(50) -- 提取 XML 中的值 SELECT value x.value(., VARCHAR(MAX))…...

Java 加密常用的各种算法及其选择

在数字化时代&#xff0c;数据安全至关重要&#xff0c;Java 作为广泛应用的编程语言&#xff0c;提供了丰富的加密算法来保障数据的保密性、完整性和真实性。了解这些常用加密算法及其适用场景&#xff0c;有助于开发者在不同的业务需求中做出正确的选择。​ 一、对称加密算法…...

三体问题详解

从物理学角度&#xff0c;三体问题之所以不稳定&#xff0c;是因为三个天体在万有引力作用下相互作用&#xff0c;形成一个非线性耦合系统。我们可以从牛顿经典力学出发&#xff0c;列出具体的运动方程&#xff0c;并说明为何这个系统本质上是混沌的&#xff0c;无法得到一般解…...

12.找到字符串中所有字母异位词

&#x1f9e0; 题目解析 题目描述&#xff1a; 给定两个字符串 s 和 p&#xff0c;找出 s 中所有 p 的字母异位词的起始索引。 返回的答案以数组形式表示。 字母异位词定义&#xff1a; 若两个字符串包含的字符种类和出现次数完全相同&#xff0c;顺序无所谓&#xff0c;则互为…...

CMake 从 GitHub 下载第三方库并使用

有时我们希望直接使用 GitHub 上的开源库,而不想手动下载、编译和安装。 可以利用 CMake 提供的 FetchContent 模块来实现自动下载、构建和链接第三方库。 FetchContent 命令官方文档✅ 示例代码 我们将以 fmt 这个流行的格式化库为例,演示如何: 使用 FetchContent 从 GitH…...

使用 SymPy 进行向量和矩阵的高级操作

在科学计算和工程领域&#xff0c;向量和矩阵操作是解决问题的核心技能之一。Python 的 SymPy 库提供了强大的符号计算功能&#xff0c;能够高效地处理向量和矩阵的各种操作。本文将深入探讨如何使用 SymPy 进行向量和矩阵的创建、合并以及维度拓展等操作&#xff0c;并通过具体…...

鸿蒙DevEco Studio HarmonyOS 5跑酷小游戏实现指南

1. 项目概述 本跑酷小游戏基于鸿蒙HarmonyOS 5开发&#xff0c;使用DevEco Studio作为开发工具&#xff0c;采用Java语言实现&#xff0c;包含角色控制、障碍物生成和分数计算系统。 2. 项目结构 /src/main/java/com/example/runner/├── MainAbilitySlice.java // 主界…...

算法笔记2

1.字符串拼接最好用StringBuilder&#xff0c;不用String 2.创建List<>类型的数组并创建内存 List arr[] new ArrayList[26]; Arrays.setAll(arr, i -> new ArrayList<>()); 3.去掉首尾空格...

高效线程安全的单例模式:Python 中的懒加载与自定义初始化参数

高效线程安全的单例模式:Python 中的懒加载与自定义初始化参数 在软件开发中,单例模式(Singleton Pattern)是一种常见的设计模式,确保一个类仅有一个实例,并提供一个全局访问点。在多线程环境下,实现单例模式时需要注意线程安全问题,以防止多个线程同时创建实例,导致…...