ベクトル演算
差分
このページの2つのバージョン間の差分を表示します。
ベクトル演算 [2023/01/26 16:27] – 作成 jmitani | ベクトル演算 [2023/01/27 10:40] (現在) – jmitani | ||
---|---|---|---|
行 1: | 行 1: | ||
ベクトルの扱い | ベクトルの扱い | ||
+ | *加算 | ||
<code python> | <code python> | ||
vector = rs.VectorAdd(vector1, | vector = rs.VectorAdd(vector1, | ||
+ | </ | ||
+ | |||
+ | *減算 | ||
+ | <code python> | ||
vector = rs.VectorSubtract(vector1, | vector = rs.VectorSubtract(vector1, | ||
+ | </ | ||
+ | |||
+ | *スケール変換 | ||
+ | <code python> | ||
vector = rs.VectorScale(vector, | vector = rs.VectorScale(vector, | ||
+ | </ | ||
+ | |||
+ | *長さの取得 | ||
+ | <code python> | ||
length = rs.VectorLength(vector) # 長さの取得 | length = rs.VectorLength(vector) # 長さの取得 | ||
+ | </ | ||
+ | |||
+ | *内積 | ||
+ | <code python> | ||
dot = rs.VectorDotProduct(vector1, | dot = rs.VectorDotProduct(vector1, | ||
+ | </ | ||
+ | |||
+ | *外積 | ||
+ | <code python> | ||
vector = rs.VectorCrossProduct(vector1, | vector = rs.VectorCrossProduct(vector1, | ||
+ | </ | ||
+ | |||
+ | *正規化 | ||
+ | <code python> | ||
vector = rs.VectorUnitize(vector) # 正規化(長さを1にする) | vector = rs.VectorUnitize(vector) # 正規化(長さを1にする) | ||
+ | </ | ||
+ | |||
+ | *3Dベクトルの回転 | ||
+ | <code python> | ||
vector = rs.VectorRotate(vector, | vector = rs.VectorRotate(vector, | ||
+ | </ | ||
+ | |||
+ | *2つの3Dベクトル間の角度 | ||
+ | <code python> | ||
angle = rs.VectorAngle(vector1, | angle = rs.VectorAngle(vector1, | ||
</ | </ | ||
ベクトル演算.1674718048.txt.gz · 最終更新: 2023/01/26 16:27 by jmitani