blob: 1bbfa514f8a34df391d7124d9050745947fd6d87 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
/*! @file emb-vector.h */
#ifndef EMB_VECTOR_H
#define EMB_VECTOR_H
#include "api-start.h"
#ifdef __cplusplus
extern "C" {
#endif
/* TODO: EmbVector should just be a typedef of EmbPoint since internally, they are the same.
In cases where it represents vector data, then the name can be used to avoid confusion.
*/
typedef struct EmbVector_
{
double X;
double Y;
} EmbVector;
typedef struct EmbVectorList_
{
EmbVector vector;
struct EmbVectorList_* next;
} EmbVectorList;
extern EMB_PUBLIC void EMB_CALL embVector_normalize(EmbVector vector, EmbVector* result);
extern EMB_PUBLIC void EMB_CALL embVector_multiply(EmbVector vector, double magnitude, EmbVector* result);
extern EMB_PUBLIC void EMB_CALL embVector_add(EmbVector v1, EmbVector v2, EmbVector* result);
extern EMB_PUBLIC double EMB_CALL embVector_getLength(EmbVector vector);
extern EMB_PUBLIC EmbVectorList* EMB_CALL embVectorList_create(EmbVector data);
extern EMB_PUBLIC EmbVectorList* EMB_CALL embVectorList_add(EmbVectorList* pointer, EmbVector data);
extern EMB_PUBLIC int EMB_CALL embVectorList_count(EmbVectorList* pointer);
extern EMB_PUBLIC int EMB_CALL embVectorList_empty(EmbVectorList* pointer);
extern EMB_PUBLIC void EMB_CALL embVectorList_free(EmbVectorList* pointer);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#include "api-stop.h"
#endif /* EMB_VECTOR_H */
/* kate: bom off; indent-mode cstyle; indent-width 4; replace-trailing-space-save on; */
|