Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Software
Shunting
Commits
8b3f43e3
Commit
8b3f43e3
authored
Sep 06, 2020
by
Thorsten Wißmann
🐧
Browse files
Rename custom operator
parent
9411d922
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/P2D.elm
View file @
8b3f43e3
...
...
@@ -30,11 +30,11 @@ segment p1 p2 pos = shift (dot (1.0 - pos) p1) (dot pos p2)
segmentCat
:
Segment
->
Segment
->
Segment
segmentCat
s1
s2
at
=
if
at
<=
0.5
then
s1
(
2.0
*
at
)
else
s2
(
2.0
*
(
at
-
0.5
))
(
∘
)
:
P2D
->
P2D
->
Float
(
∘
)
p1
p2
=
p1
.
x
*
p2
.
x
+
p1
.
y
*
p2
.
y
scalarProduct
:
P2D
->
P2D
->
Float
scalarProduct
p1
p2
=
p1
.
x
*
p2
.
x
+
p1
.
y
*
p2
.
y
norm
:
P2D
->
Float
norm
vec
=
sqrt
<|
vec
∘
vec
norm
vec
=
sqrt
<|
scalarProduct
vec
vec
rad
:
Float
->
Float
->
P2D
rad
angle360
distance
=
...
...
src/TrackA.elm
View file @
8b3f43e3
...
...
@@ -56,7 +56,7 @@ trackArcCenter ta =
--
-- where 'o' is the composition of matrices.
let
rhs
=
{
x
=
n1
∘
ta
.
p1
,
y
=
n2
∘
ta
.
p2
}
-- right hand side
rhs
=
{
x
=
scalarProduct
n1
ta
.
p1
,
y
=
scalarProduct
n2
ta
.
p2
}
-- right hand side
xs
=
{
x
=
n1
.
x
,
y
=
n2
.
x
}
-- first column
ys
=
{
x
=
n1
.
y
,
y
=
n2
.
y
}
-- second column
center
=
...
...
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