Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T800
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Harbor Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
Vytor Calixto
T800
Commits
ed356729
Commit
ed356729
authored
9 years ago
by
Victor Perszel
Browse files
Options
Downloads
Patches
Plain Diff
Funçao que calcula menor distancia entre pontos
parent
2303bd34
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
main.c
+11
-2
11 additions, 2 deletions
main.c
with
11 additions
and
2 deletions
main.c
+
11
−
2
View file @
ed356729
...
...
@@ -5,9 +5,13 @@
// Não tenho ideia desse valor
// Ou da unidade (15 cm?)
int
menorDistancia
(
xa
,
ya
,
xb
,
yb
){
return
(
sqrt
((
xb
-
xa
)
*
(
xb
-
xa
)
+
(
yb
-
ya
)
*
(
yb
-
ya
)));
}
int
main
(
int
argc
,
char
const
*
argv
[])
{
/* code */
int
i
=
0
;
// Contador
int
i
=
0
,
dist
;
int
tuplas
[
10
][
3
];
// Vetor de coordenadas x, y e tempo
puts
(
"Por favor insira as coordenadas na qual o robô deverá passar e seu tempo"
);
puts
(
"(Ex: x1 y1 tempo1
\n
x2 y2 tempo2
\n
...
\n
xn yn tempon)"
);
...
...
@@ -16,7 +20,12 @@ int main(int argc, char const *argv[]) {
++
i
;
}
// calcular velocidade dos pontos entre cada coordenada
// Fiz uma função que calcula a menor distância entre pontos, não sei se é útil
for
(
i
=
0
;
i
<
10
;
++
i
){
dist
=
menorDistancia
(
tuplas
[
i
][
0
],
tuplas
[
i
][
1
],
tuplas
[
i
+
1
][
0
],
tuplas
[
i
+
1
][
1
]);
}
// calcular velocidade das rodas entre cada coordenada
// gerar tabela e grafico
return
0
;
...
...
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