Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Analyst WebApp
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
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
fidentis
Analyst WebApp
Commits
506719d5
There was an error fetching the commit references. Please try again later.
Commit
506719d5
authored
4 years ago
by
Natália Bebjaková
Browse files
Options
Downloads
Patches
Plain Diff
MeshPoint changed
parent
dd9d348f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshPoint.java
+28
-17
28 additions, 17 deletions
...rc/main/java/cz/fidentis/analyst/mesh/core/MeshPoint.java
with
28 additions
and
17 deletions
MeshModel/src/main/java/cz/fidentis/analyst/mesh/core/MeshPoint.java
+
28
−
17
View file @
506719d5
...
...
@@ -128,18 +128,12 @@ public class MeshPoint {
return
new
MeshPoint
(
new
Vector3d
(
newPosition
),
null
,
null
);
}
/*public MeshPoint addPosition(MeshPoint b) {
return (new MeshPoint(new Vector3d(this.getPosition().x + b.getPosition().x,
this.getPosition().y + b.getPosition().y, this.getPosition().z + b.getPosition().z),
null, null));
}*/
/* public MeshPoint subtractPosition(MeshPoint b) {
return (new MeshPoint(new Vector3d(this.getPosition().x - b.getPosition().x,
this.getPosition().y - b.getPosition().y, this.getPosition().z - b.getPosition().z),
null, null));
}*/
/**
* returns new instance of MeshPoint with multiplied position by number
*
* @param number Number for multiplying
* @return multiplied MeshPoint
*/
public
MeshPoint
multiplyPosition
(
double
number
)
{
if
(
normal
!=
null
)
{
if
(
texCoord
!=
null
)
...
...
@@ -156,6 +150,12 @@ public class MeshPoint {
null
,
null
);
}
/**
* returns new instance of MeshPoint with divided position by number
*
* @param number Number for division
* @return divided MeshPoint
*/
public
MeshPoint
dividePosition
(
double
number
)
{
if
(
normal
!=
null
)
{
if
(
texCoord
!=
null
)
...
...
@@ -169,11 +169,11 @@ public class MeshPoint {
this
.
getPosition
().
z
/
number
),
null
,
null
);
}
/**
* Returns the cross product of two points.
@param meshPoint Second argument of the cross product operation.
* @
return
@return
s
Point
3D
representing the resulting vector.
/**
* Returns the cross product of two points.
*
* @
param meshPoint Second argument of the cross product operation.
*
@return
Mesh
Point representing the resulting vector.
*/
public
MeshPoint
crossProduct
(
MeshPoint
meshPoint
)
{
if
(
normal
!=
null
)
{
...
...
@@ -197,10 +197,21 @@ public class MeshPoint {
null
,
null
);
}
/**
* returns the dot product of two points
*
* @param meshPoint Second argument of the dot product operation
* @return dot product of two instances of MeshPoint
*/
public
double
dotProduct
(
MeshPoint
meshPoint
)
{
return
(
this
.
position
.
x
*
meshPoint
.
position
.
x
+
this
.
position
.
y
*
meshPoint
.
position
.
y
+
this
.
position
.
z
*
meshPoint
.
position
.
z
);
}
/**
* returns absolute value of MeshPoint
*
* @return absolute value of MeshPoint
*/
public
double
abs
()
{
return
Math
.
sqrt
(
this
.
getPosition
().
x
*
this
.
getPosition
().
x
+
this
.
getPosition
().
y
*
this
.
getPosition
().
y
+
this
.
getPosition
().
z
*
this
.
getPosition
().
z
);
...
...
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