mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-05 17:07:11 +02:00
34 lines
684 B
C
34 lines
684 B
C
/*
|
|
* misc.h - Helper functions for geometry and attributes
|
|
*
|
|
* Written 2016 by Werner Almesberger
|
|
* Copyright 2016 Werner Almesberger
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
* (at your option) any later version.
|
|
*/
|
|
|
|
|
|
#ifndef MISC_H
|
|
#define MISC_H
|
|
|
|
#include <stdbool.h>
|
|
|
|
|
|
static inline int mx(int x, int y, int m[6])
|
|
{
|
|
return m[0] + x * m[1] + y * m[2];
|
|
}
|
|
|
|
|
|
static inline int my(int x, int y, int m[6])
|
|
{
|
|
return m[3] + x * m[4] + y * m[5];
|
|
}
|
|
|
|
unsigned matrix_to_angle(int m[6]);
|
|
|
|
#endif /* !MISC_H */
|