packages/cafeteria/app/external/sylvester/scripts/sylvester-0.1.3.js
function(anchor, direction) {
    // Need to do this so that line's properties are not
    // references to the arguments passed in
    anchor = Vector.create(anchor);
    direction = Vector.create(direction);
    if (anchor.elements.length == 2) {anchor.elements.push(0); }
    if (direction.elements.length == 2) { direction.elements.push(0); }
    if (anchor.elements.length > 3 || direction.elements.length > 3) { return null; }
    var mod = direction.modulus();
    if (mod === 0) { return null; }
    this.anchor = anchor;
    this.direction = Vector.create([
      direction.elements[0] / mod,
      direction.elements[1] / mod,
      direction.elements[2] / mod
    ]);
    return this;
  }
function(anchor, direction) {
    // Need to do this so that line's properties are not
    // references to the arguments passed in
    anchor = Vector.create(anchor);
    direction = Vector.create(direction);
    if (anchor.elements.length == 2) {anchor.elements.push(0); }
    if (direction.elements.length == 2) { direction.elements.push(0); }
    if (anchor.elements.length > 3 || direction.elements.length > 3) { return null; }
    var mod = direction.modulus();
    if (mod === 0) { return null; }
    this.anchor = anchor;
    this.direction = Vector.create([
      direction.elements[0] / mod,
      direction.elements[1] / mod,
      direction.elements[2] / mod
    ]);
    return this;
  }
function ( anchor , direction ) { // Need to do this so that line's properties are not // references to the arguments passed in anchor = Vector . create ( anchor ) ; direction = Vector . create ( direction ) ; if ( anchor . elements . length == 2 ) { anchor . elements . push ( 0 ) ; } if ( direction . elements . length == 2 ) { direction . elements . push ( 0 ) ; } if ( anchor . elements . length > 3 || direction . elements . length > 3 ) { return null ; } var mod = direction . modulus ( ) ; if ( mod === 0 ) { return null ; } this . anchor = anchor ; this . direction = Vector . create ( [ direction . elements [ 0 ] / mod , direction . elements [ 1 ] / mod , direction . elements [ 2 ] / mod ] ) ; return this ; }
Set the line's anchor point and direction.
Set the line s anchor point and direction .