Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
V
vec2d
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Luke Jones
vec2d
Commits
b3baab23
Commit
b3baab23
authored
May 22, 2019
by
Luke Jones
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix normalise
parent
276c28ff
Pipeline
#62700420
passed with stages
in 3 minutes and 52 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
Cargo.toml
Cargo.toml
+1
-1
src/lib.rs
src/lib.rs
+1
-1
No files found.
Cargo.toml
View file @
b3baab23
[package]
name
=
"vec2d"
version
=
"0.1.
0
"
version
=
"0.1.
1
"
authors
=
[
"Luke Jones <luke@sphereidentity.com>"
]
edition
=
"2018"
...
...
src/lib.rs
View file @
b3baab23
...
...
@@ -25,7 +25,7 @@ macro_rules! impl_vec_ops_for {
/// Normalises the vector
pub
fn
normalise
(
self
)
->
Self
{
let
mut
magnitude
=
self
.magnitude
();
if
magnitude
<=
0.0001
{
magnitude
=
1
.0
}
if
magnitude
<=
0.0001
{
magnitude
=
0
.0
}
self
/
magnitude
}
/// Returns the magnitude/length of the vector
...
...
Write
Preview
Markdown
is supported
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