Members
-
r
-
The length r ({Number}) of
thisvector.- Source:
-
x
-
The x-coordinate ({Number}) of
thisvector.- Source:
-
y
-
The y-coordinate ({Number}) of
thisvector.- Source:
-
φ
-
The angle φ ({Number}) of
thisvector- Source:
Methods
-
"setRΘ"(p_r, p_φ)
-
Sets both polar coordinate attributes
randφofthisvector simultaneously.Parameters:
Name Type Description p_rNumber The length of thisvector.p_φNumber The angle (w.r.t the x-axis) of thisvector.- Source:
-
$wk$(p_modules, p_environment_i, p_sandbox, p_annotations)
-
The sandbox pattern: When this function is evaluated, it first loads all modules stated in
p_modulesand then calls the callback function passed as last argument:function(p_wk, p_env_1, ... p_env_n) { // code running in a sandbox }Parameters:
Name Type Argument Description p_modulesArray.<String> | Array <optional>
A module name or a list of module names. A module name is a string "p1.p2.p3.M", consiting of zero ore more package/subpackage names p_iand the module nameMproper. IfM === "*", all modules within the package are loaded. IfM === "**", all modules within the package and all subpackages, subsubpackages etc. are loaded.p_environment_iObject <optional>
Zero or more environments objects, where the content of the modules are stored. p_sandboxfunction <optional>
The sandbox, a callback function: function(p_wk, p_env_1, ... p_env_n){ ...}pwkis an instance of$wk$. The environment object contain thep_modulesloaded. If there are more modules stated than environment objects, the last environment object contains the surplus modules. If no environment objects are passed, all modules are stored withinp_wk.p_annotationsString | Array | Object Annotations that control the behaviour of the code executed within the sandbox. Plaes note: An annotation object may only be stated, if p_sandboxhas been stated. Otherwise an object is interpreted as environment object. -
addReplace(p_v, p_s) → {WKcVector2D}
-
Modifies
thisvector by adding another vectorp_vmultiplied by a scalar factor to it.Parameters:
Name Type Argument Default Description p_vWKcVector2D The vector to be added. p_sNumber <optional>
1 The scalar factor. - Source:
Returns:
this- Type
- WKcVector2D
-
normalReplace() → {WKcVector2D}
-
Replaces
thisvector by a vector that is rotated 90 degrees counterclockwise. The length is preserved.- Source:
Returns:
this- Type
- WKcVector2D
-
projReplace(p_v) → {WKcVector2D}
-
Replaces
thisvector by a projection ofthisvector onto another vectorp_v.Parameters:
Name Type Description p_vWKcVector2D The vector onto which thisvector is projected.- Source:
Returns:
this, which now is a multiple ofp_v.- Type
- WKcVector2D
-
reflectReplace(p_m, p_s) → {WKcVector2D}
-
Replaces
thisvector by the reflection vector that arises fromthisvector being reflected by a "mirror" vectorv_m. The length of the reflection vector is the same as the length ofthisvector multiplied by a scalar factor.Parameters:
Name Type Argument Default Description p_mWKcVector2D The mirror vector. p_sNumber <optional>
1 The scalar factor. - Source:
Returns:
this- Type
- WKcVector2D
-
replace(p_v) → {WKcVector2D}
-
Replaces the coordinates of
thisvector by the coordinates of another vectorp_v.Parameters:
Name Type Description p_vWKcVector2D The other vector. - Source:
Returns:
this- Type
- WKcVector2D
-
scaleReplace(p_s) → {WKcVector2D}
-
Modifies
thisvector by multiplying it with a scalar value.Parameters:
Name Type Description p_sNumber The scalar value. - Source:
Returns:
this- Type
- WKcVector2D
-
setXY(p_x, p_y)
-
Sets both cartesian coordinate attributes
xandyofthisvector simultaneously.Parameters:
Name Type Description p_xNumber The x-coordinate of thisvector.p_yNumber The y-coordinate of thisvector.- Source:
-
subReplace(p_v, p_s) → {WKcVector2D}
-
Modifies
thisvector by subtracting another vectorp_vmultiplied by a scalar factor from it.Parameters:
Name Type Argument Default Description p_vWKcVector2D The vector to be added. p_sNumber <optional>
1 The scalar factor. - Source:
Returns:
this- Type
- WKcVector2D
-
unitReplace() → {WKcVector2D}
-
Modifies
thisvector by normalizing it.- Source:
Returns:
this- Type
- WKcVector2D