Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
boids
boids4
Commits
0547ec33
Commit
0547ec33
authored
Oct 31, 2015
by
Cassio Kirch
Browse files
double * int instead of int * double
parent
2359b00a
Changes
1
Show whitespace changes
Inline
Side-by-side
boid.c
View file @
0547ec33
...
@@ -30,7 +30,7 @@ initializeCircleCorrectly(struct Boid* const boid)
...
@@ -30,7 +30,7 @@ initializeCircleCorrectly(struct Boid* const boid)
double
angle
,
radius
;
double
angle
,
radius
;
angle
=
RANDOM_0
(
PI
*
2
.
0
);
angle
=
RANDOM_0
(
PI
*
2
.
0
);
radius
=
sqrt
(
RANDOM_0
(
1
.
0
))
*
\
radius
=
sqrt
(
RANDOM_0
(
1
.
0
))
*
\
sqrt
(
N
*
0
.
137832224
)
*
ELASTIC_DISTANCE
;
sqrt
(
0
.
137832224
*
N
)
*
ELASTIC_DISTANCE
;
/* R^2 = re^2 * N * sqrt(3) / (4 pi) */
/* R^2 = re^2 * N * sqrt(3) / (4 pi) */
boid
->
position
[
X
]
=
radius
*
cos
(
angle
);
boid
->
position
[
X
]
=
radius
*
cos
(
angle
);
boid
->
position
[
Y
]
=
radius
*
sin
(
angle
);
boid
->
position
[
Y
]
=
radius
*
sin
(
angle
);
...
...
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