Global

Members

r

The length r ({Number}) of this vector.
Source:

x

The x-coordinate ({Number}) of this vector.
Source:

y

The y-coordinate ({Number}) of this vector.
Source:

φ

The angle φ ({Number}) of this vector
Source:

Methods

"setRΘ"(p_r, p_φ)

Sets both polar coordinate attributes r and φ of this vector simultaneously.
Parameters:
Name Type Description
p_r Number The length of this vector.
p_φ Number The angle (w.r.t the x-axis) of this vector.
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_modules and 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_modules Array.<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_i and the module name M proper. If M === "*", all modules within the package are loaded. If M === "**", all modules within the package and all subpackages, subsubpackages etc. are loaded.
p_environment_i Object <optional>
Zero or more environments objects, where the content of the modules are stored.
p_sandbox function <optional>
The sandbox, a callback function: function(p_wk, p_env_1, ... p_env_n){ ...} pwk is an instance of $wk$. The environment object contain the p_modules loaded. 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 within p_wk.
p_annotations String | 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_sandbox has been stated. Otherwise an object is interpreted as environment object.
Source:
See:
  • Stoyan Stefanov, JavaScript Patterns. O'Reilly, 2010

addReplace(p_v, p_s) → {WKcVector2D}

Modifies this vector by adding another vector p_v multiplied by a scalar factor to it.
Parameters:
Name Type Argument Default Description
p_v WKcVector2D The vector to be added.
p_s Number <optional>
1 The scalar factor.
Source:
Returns:
this
Type
WKcVector2D

normalReplace() → {WKcVector2D}

Replaces this vector by a vector that is rotated 90 degrees counterclockwise. The length is preserved.
Source:
Returns:
this
Type
WKcVector2D

projReplace(p_v) → {WKcVector2D}

Replaces this vector by a projection of this vector onto another vector p_v.
Parameters:
Name Type Description
p_v WKcVector2D The vector onto which this vector is projected.
Source:
Returns:
this, which now is a multiple of p_v.
Type
WKcVector2D

reflectReplace(p_m, p_s) → {WKcVector2D}

Replaces this vector by the reflection vector that arises from this vector being reflected by a "mirror" vector v_m. The length of the reflection vector is the same as the length of this vector multiplied by a scalar factor.
Parameters:
Name Type Argument Default Description
p_m WKcVector2D The mirror vector.
p_s Number <optional>
1 The scalar factor.
Source:
Returns:
this
Type
WKcVector2D

replace(p_v) → {WKcVector2D}

Replaces the coordinates of this vector by the coordinates of another vector p_v.
Parameters:
Name Type Description
p_v WKcVector2D The other vector.
Source:
Returns:
this
Type
WKcVector2D

scaleReplace(p_s) → {WKcVector2D}

Modifies this vector by multiplying it with a scalar value.
Parameters:
Name Type Description
p_s Number The scalar value.
Source:
Returns:
this
Type
WKcVector2D

setXY(p_x, p_y)

Sets both cartesian coordinate attributes x and y of this vector simultaneously.
Parameters:
Name Type Description
p_x Number The x-coordinate of this vector.
p_y Number The y-coordinate of this vector.
Source:

subReplace(p_v, p_s) → {WKcVector2D}

Modifies this vector by subtracting another vector p_v multiplied by a scalar factor from it.
Parameters:
Name Type Argument Default Description
p_v WKcVector2D The vector to be added.
p_s Number <optional>
1 The scalar factor.
Source:
Returns:
this
Type
WKcVector2D

unitReplace() → {WKcVector2D}

Modifies this vector by normalizing it.
Source:
Returns:
this
Type
WKcVector2D
W. Kowarschick © 2013 (CC BY-NC-SA 3.0: http://creativecommons.org/licenses/by-nc-sa/3.0/)
Documentation generated by JSDoc 3.3.0-dev on Sat Oct 05 2013 15:14:39 GMT+0200 (MESZ) using the DocStrap template.