Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F97278996
signe.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Jan 4, 00:12
Size
1 KB
Mime Type
text/x-c
Expires
Mon, Jan 6, 00:12 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23372129
Attached To
R1448 Lenstool-HPC
signe.c
View Options
#include<stdio.h>
#include<math.h>
#include<fonction.h>
#include<constant.h>
#include<dimension.h>
#include<structure.h>
/****************************************************************/
/* nom: signe */
/* auteur: Jean-Paul Kneib */
/* date: 10/02/92 */
/* place: Toulouse */
/****************************************************************/
/* Return >0 if P and T->c are on the same side of the [T->a,T->b]
* segment, otherwise <0.
*
* Return 0, if P or c are on the [T->a,T->b] segment.
*
* Global variables used :
* - none
*/
double signe(const struct triplet *T, const struct point *P)
{
return(determinant(&T->a, &T->b, P)*determinant(&T->a, &T->b, &T->c));
}
/*********************************************************************/
/* Return the scalar triple product (a*b).c of the 3 vectors A[x,y,1],
* B[x,y,1], C[x,y,1].
* If 2 of the 3 vectors are equal, colinear or form an orthogonal basis,
* the triple product is 0.
* This is also the determinant of the matrix
* | Ax Bx Cx |
* | Ay By Cy |
* | 1 1 1 |
*
* Global variables used :
* - none
*/
double determinant(const struct point *A,
const struct point *B,
const struct point *C)
{
return( B->x * C->y - B->y * C->x +
A->x * B->y - A->y * B->x +
A->y * C->x - A->x * C->y );
}
Event Timeline
Log In to Comment