Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mappevurderingprog2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tam Minh Le
mappevurderingprog2
Commits
9e4ad01d
Commit
9e4ad01d
authored
1 year ago
by
Tam Le
Browse files
Options
Downloads
Patches
Plain Diff
Refactored: JuliaTransform method
parent
32024d15
No related branches found
No related tags found
1 merge request
!5
Refactored: JuliaTransform method
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/JuliaTransform.java
+5
-10
5 additions, 10 deletions
...du/ntnu/idatt2003/mappevurderingprog2/JuliaTransform.java
with
5 additions
and
10 deletions
src/main/java/edu/ntnu/idatt2003/mappevurderingprog2/JuliaTransform.java
+
5
−
10
View file @
9e4ad01d
...
...
@@ -11,18 +11,13 @@ public class JuliaTransform implements Transform2D{
@Override
public
Vector2D
transform
(
Vector2D
point
)
{
double
x
=
point
.
getX0
();
double
y
=
point
.
getX1
();
double
newX
=
x
*
x
-
y
*
y
+
this
.
point
.
getX0
();
double
newY
=
2
*
x
*
y
+
this
.
point
.
getX1
();
if
(
sign
==
-
1
)
{
newX
=
-
newX
;
newY
=
-
newY
;
if
(!(
point
instanceof
Complex
))
{
throw
new
IllegalArgumentException
(
"The point must be a complex number"
);
}
return
new
Vector2D
(
newX
,
newY
);
Complex
newVector
=
(
Complex
)
point
.
subtract
(
this
.
point
);
return
newVector
.
sqrt
();
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment