Difference between revisions of "Shear transformation"

From JSXGraph Wiki
Jump to navigationJump to search
Line 19: Line 19:
 
var y = board.defaultAxes.y;
 
var y = board.defaultAxes.y;
  
var q = board.create('point', [1, 7], {name: 'q', snapToGrid: false});
+
var q = board.create('point', [2, 8], {name: 'q', snapToGrid: false});
 
var q1 = board.create('point', [
 
var q1 = board.create('point', [
 
         () => q.X() + q.Y(),
 
         () => q.X() + q.Y(),
Line 36: Line 36:
 
var r1 = board.create('line', [[0, 0], q], {straightFirst: false});
 
var r1 = board.create('line', [[0, 0], q], {straightFirst: false});
  
var p = board.create('glider', [2, 8, r1], {name: 'p'});
+
var p = board.create('glider', [1, 3, r1], {name: 'p'});
 
var p1 = board.create('point', [
 
var p1 = board.create('point', [
 
         () => p.X() + p.Y(),
 
         () => p.X() + p.Y(),

Revision as of 08:30, 31 May 2021

Shear transformation

[math] \varphi: {\cal A}(\mathbb{R}^2) \to {\cal A}(\mathbb{R}^2), \; x \mapsto \begin{pmatrix}1 & 1 \\ 0& 1\end{pmatrix} [/math]

Points of the form [math]{x\choose \lambda}[/math] are mapped to:

[math] \varphi({x\choose \lambda}) = {x + \lambda\choose} [/math]

The underlying JavaScript code

JXG.Options.label.autoPosition = true;
JXG.Options.text.fontSize = 20;
var board = JXG.JSXGraph.initBoard('jxgbox', { boundingbox: [-10, 10, 10, -10], axis: true});

var x = board.defaultAxes.x;
var y = board.defaultAxes.y;

var q = board.create('point', [1, 2], {name: 'q', snapToGrid: true});
var q1 = board.create('point', [
        () => q.X() + q.Y(),
        () => q.Y()
    ], {name: 'φ(q)'});

var qx = board.create('point', [
        () => q.X(),
        () => 0
    ], {visible: false});

var s1 = board.create('segment', [q, q1], {dash:2});
var s2 = board.create('segment', [qx, q], {dash:2});