Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ronan
coraMaths
Commits
929b0067
Commit
929b0067
authored
Jun 05, 2016
by
ronan
Browse files
Add setLength Rectangle
parent
8d02d73c
Pipeline
#2258
passed with stage
in 58 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
cora/cora-maths/1.0/cora-maths-1.0-javadoc.jar
View file @
929b0067
No preview for this file type
cora/cora-maths/1.0/cora-maths-1.0-sources.jar
View file @
929b0067
No preview for this file type
cora/cora-maths/1.0/cora-maths-1.0.jar
View file @
929b0067
No preview for this file type
src/main/java/org/cora/maths/Rectangle.java
View file @
929b0067
...
...
@@ -149,6 +149,33 @@ public class Rectangle extends Form
set
(
new
Vector2D
(
x
,
y
),
new
Vector2D
(
width
,
height
));
}
/**
* @param width rec size
* @param height rec size
*/
public
void
setLength
(
float
width
,
float
height
)
{
this
.
length
.
set
(
width
,
height
);
points
.
get
(
0
).
set
(-
0.5f
*
length
.
x
,-
0.5f
*
length
.
y
);
points
.
get
(
1
).
set
(-
0.5f
*
length
.
x
,+
0.5f
*
length
.
y
);
points
.
get
(
2
).
set
(+
0.5f
*
length
.
x
,+
0.5f
*
length
.
y
);
points
.
get
(
3
).
set
(+
0.5f
*
length
.
x
,-
0.5f
*
length
.
y
);
}
/**
* @param length rec size
*/
public
void
setLength
(
Vector2D
length
)
{
this
.
length
.
set
(
length
);
points
.
get
(
0
).
set
(-
0.5f
*
length
.
x
,-
0.5f
*
length
.
y
);
points
.
get
(
1
).
set
(-
0.5f
*
length
.
x
,+
0.5f
*
length
.
y
);
points
.
get
(
2
).
set
(+
0.5f
*
length
.
x
,+
0.5f
*
length
.
y
);
points
.
get
(
3
).
set
(+
0.5f
*
length
.
x
,-
0.5f
*
length
.
y
);
}
public
void
set
(
Rectangle
rec
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment