Dung.Dang@gmail.com | My favorites | Profile | Sign out
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes  
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */

/*
Part of the Processing project - http://processing.org

Copyright (c) 2005-08 Ben Fry and Casey Reas

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
*/

package processing.core;


public interface PMatrix {

public void reset();

/**
* Returns a copy of this PMatrix.
*/
public PMatrix get();

/**
* Copies the matrix contents into a float array.
* If target is null (or not the correct size), a new array will be created.
*/
public float[] get(float[] target);


public void set(PMatrix src);

public void set(float[] source);

public void set(float m00, float m01, float m02,
float m10, float m11, float m12);

public void set(float m00, float m01, float m02, float m03,
float m10, float m11, float m12, float m13,
float m20, float m21, float m22, float m23,
float m30, float m31, float m32, float m33);


public void translate(float tx, float ty);

public void translate(float tx, float ty, float tz);

public void rotate(float angle);

public void rotateX(float angle);

public void rotateY(float angle);

public void rotateZ(float angle);

public void rotate(float angle, float v0, float v1, float v2);

public void scale(float s);

public void scale(float sx, float sy);

public void scale(float x, float y, float z);

public void shearX(float angle);

public void shearY(float angle);

/**
* Multiply this matrix by another.
*/
public void apply(PMatrix source);

public void apply(PMatrix2D source);

public void apply(PMatrix3D source);

public void apply(float n00, float n01, float n02,
float n10, float n11, float n12);

public void apply(float n00, float n01, float n02, float n03,
float n10, float n11, float n12, float n13,
float n20, float n21, float n22, float n23,
float n30, float n31, float n32, float n33);

/**
* Apply another matrix to the left of this one.
*/
public void preApply(PMatrix2D left);

public void preApply(PMatrix3D left);

public void preApply(float n00, float n01, float n02,
float n10, float n11, float n12);

public void preApply(float n00, float n01, float n02, float n03,
float n10, float n11, float n12, float n13,
float n20, float n21, float n22, float n23,
float n30, float n31, float n32, float n33);


/**
* Multiply a PVector by this matrix.
*/
public PVector mult(PVector source, PVector target);


/**
* Multiply a multi-element vector against this matrix.
*/
public float[] mult(float[] source, float[] target);


// public float multX(float x, float y);
// public float multY(float x, float y);

// public float multX(float x, float y, float z);
// public float multY(float x, float y, float z);
// public float multZ(float x, float y, float z);


/**
* Transpose this matrix.
*/
public void transpose();


/**
* Invert this matrix.
* @return true if successful
*/
public boolean invert();


/**
* @return the determinant of the matrix
*/
public float determinant();
}

Change log

r7133 by f...@processing.org on Jul 18, 2010   Diff
change skewX/Y to shearX/Y
Go to: 

Older revisions

r4997 by fry on Oct 21, 2008   Diff
adding style attributes for svg, also
fix the spacing in the file
r4731 by fry on Oct 08, 2008   Diff
more work on matrix functions,
implement matrices for PShape, addl
note in
PGraphics
r4712 by fry on Oct 02, 2008   Diff
give up on wrapping AffineTransform
and other matrices
All revisions of this file

File info

Size: 4016 bytes, 150 lines
Powered by Google Project Hosting