--- title: 求向量長度 tags: math, geometry --- # 求向量長度 $\overrightarrow{v}=(x,y,z)$ ## 一般求法 $|\overrightarrow{v}|=\sqrt{x^2+y^2+z^2\ }$ ## Minecraft特殊求法 取得向量之角度 $(\theta, \phi)$ 生成球座標上一個點作為向量:$\overrightarrow{u}=(1, \theta, \phi)=(x',y',z')$ 利用內積取值即是長度:$|\overrightarrow{v}|=\overrightarrow{v}\cdot\overrightarrow{u}$ 這可以有效省去需要開根號的算法 > $\overrightarrow{v}\cdot\overrightarrow{u}=|\overrightarrow{v}||\overrightarrow{u}|\cos\theta$ > $|\overrightarrow{u}|=1,\ \theta=0$
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up