Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Computergraphics
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
Container 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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christoph-Anton Schwierz
Computergraphics
Commits
3b82b1c8
Commit
3b82b1c8
authored
1 year ago
by
Christoph-Anton Schwierz
Browse files
Options
Downloads
Patches
Plain Diff
utils created, linear operators for vectors;
parent
03519819
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cg/utils.ts
+30
-0
30 additions, 0 deletions
src/cg/utils.ts
with
30 additions
and
0 deletions
src/cg/utils.ts
0 → 100644
+
30
−
0
View file @
3b82b1c8
export
function
vecAdd
(
vecOne
:
Array
<
number
>
,
vecTwo
:
Array
<
number
>
){
let
vecSum
:
Array
<
number
>
=
vecOne
;
vecSum
[
0
]
+=
vecTwo
[
0
];
vecSum
[
1
]
+=
vecTwo
[
1
];
vecSum
[
2
]
+=
vecTwo
[
2
];
return
vecSum
;
}
export
function
vecSubtract
(
vecOne
:
Array
<
number
>
,
vecTwo
:
Array
<
number
>
){
let
vecSubt
:
Array
<
number
>
=
vecOne
;
vecSubt
[
0
]
-=
vecTwo
[
0
];
vecSubt
[
1
]
-=
vecTwo
[
1
];
vecSubt
[
2
]
-=
vecTwo
[
2
];
return
vecSubt
;
}
export
function
vecMultiply
(
vecOne
:
Array
<
number
>
,
factor
:
number
){
vecOne
[
0
]
*=
factor
;
vecOne
[
1
]
*=
factor
;
vecOne
[
2
]
*=
factor
;
return
vecOne
;
}
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