{Vector3d-of ordinate-type:Type} (クラス)
public final Vector3d-of
パッケージ: CURL.LANGUAGE.UNITS

不変の 3D ベクトル。

注意事項

ordinate-type は、double または Distance のような浮動小数点型でなければなりません。

コンストラクタ
default:コンポーネントから作成します。
コンストラクタ public {Vector3d-of.default
x:ordinate-type,
y:ordinate-type,
z:ordinate-type
}
zero:値が 0 のフィールドを作成します。
ファクトリ public implicit inline {Vector3d-of.zero}:{this-class}

プロパティ
magnitude:この Vector3d の大きさを返します。
アクセサ public final Vector3d-of.magnitude:ordinate-type
x:ベクトルの最初の成分。
フィールド public constant Vector3d-of.x:ordinate-type
y:ベクトルの 2 番目の成分。
フィールド public constant Vector3d-of.y:ordinate-type
z:ベクトルの 3 番目の成分。
フィールド public constant Vector3d-of.z:ordinate-type
zero-magnitude?:3D ベクトルの大きさがゼロの場合は、true を返します。
アクセサ public final Vector3d-of.zero-magnitude?:bool

メソッド
clone:self を返します。
public {Vector3d-of.clone}:{Vector3d-of ordinate-type}
direction:この Vector3d の方向を単位なしベクトルとして表します。
public {Vector3d-of.direction
}:{Vector3d-of {compile-time-type-of {value let x:ordinate-type x / x} } }



コンストラクタ詳細
default (コンストラクタ)
public {Vector3d-of.default
x:ordinate-type,
y:ordinate-type,
z:ordinate-type
}

コンポーネントから作成します。

説明

個々のコンポーネントからベクトルを作成します。


zero (ファクトリ)
public implicit inline {Vector3d-of.zero}:{this-class}

値が 0 のフィールドを作成します。

導入: バージョン 6.0



プロパティ詳細
magnitude (アクセサ)
アクセサ public final Vector3d-of.magnitude:ordinate-type

この Vector3d の大きさを返します。



x (フィールド)
public constant Vector3d-of.x:ordinate-type

ベクトルの最初の成分。



y (フィールド)
public constant Vector3d-of.y:ordinate-type

ベクトルの 2 番目の成分。



z (フィールド)
public constant Vector3d-of.z:ordinate-type

ベクトルの 3 番目の成分。



zero-magnitude? (アクセサ)
アクセサ public final Vector3d-of.zero-magnitude?:bool

3D ベクトルの大きさがゼロの場合は、true を返します。

説明

normalize または direction メソッドによってスローされる例外を予想するために、このアクセッサを使用します。





メソッド詳細
clone (メソッド)
public {Vector3d-of.clone}:{Vector3d-of ordinate-type}

self を返します。

説明

このメソッドが実装されるのは、配列のような特定の構造に特定のデータ型の clone メソッドが必要なためです。

注意事項

このメソッドは、それ自体の新しいインスタンスではなく self を返しますが、Vector3d-of は不変であり、そのデータを変更できないので、この 3D ベクトル内のデータは安全です。


direction (メソッド)
public {Vector3d-of.direction
}:{Vector3d-of {compile-time-type-of {value let x:ordinate-type x / x} } }

この Vector3d の方向を単位なしベクトルとして表します。

注意事項

ベクトルの大きさが 0 の場合は、例外をスローします。

プログラミング注意事項

結果は単位なしです。ベクトルの大きさがゼロの場合、結果はゼロ ベクトルです。

v.magnitude * v.directionv は、浮動小数点エラーだけが異なります。