X-Git-Url: http://git.droids-corp.org/?p=aversive.git;a=blobdiff_plain;f=modules%2Fbase%2Fmath%2Fgeometry%2Fvect_base.h;h=b511e076990f9258296a93726a093b6a4a7b0d6f;hp=b9dda3f9f2ef545a70f16860c119f33894531eb0;hb=80386d268a58da2be3eeca83f254c980a047b34f;hpb=bd8acd4f11e6720c96946a7537df5538c0a9a5d4 diff --git a/modules/base/math/geometry/vect_base.h b/modules/base/math/geometry/vect_base.h index b9dda3f..b511e07 100755 --- a/modules/base/math/geometry/vect_base.h +++ b/modules/base/math/geometry/vect_base.h @@ -1,21 +1,43 @@ +/* + * Copyright Droids Corporation (2009) + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * Revision : $Id: f16.h,v 1.6.4.3 2008-05-10 15:06:26 zer0 Exp $ + * + */ + +#ifndef _VECT_BASE_H_ +#define _VECT_BASE_H_ + typedef struct _vect_t { - int32_t x; - int32_t y; -}vect_t; + float x; + float y; +} vect_t; typedef struct _point_t { - int32_t x; - int32_t y; -}point_t; - + float x; + float y; +} point_t; - /* Return scalar product */ -int32_t +float vect_pscal(vect_t *v, vect_t *w); /* Return Z of vectorial product */ -int32_t +float vect_pvect(vect_t *v, vect_t *w); /* Return scalar product */ @@ -27,8 +49,13 @@ int8_t vect_pvect_sign(vect_t *v, vect_t *w); /* norm of a vector */ +float norm(float x1, float y1, float x2, float y2); +float pt_norm(point_t *p1, point_t *p2); float vect_norm(vect_t *v); void vect_rot_trigo(vect_t *v); void vect_rot_retro(vect_t *v); float vect_get_angle(vect_t *v, vect_t *w); - + +void vect_resize(vect_t *v, float l); + +#endif /* _VECT_BASE_H_ */