Ejemplo n.º 1
0
void _Sphere_DistanceFromCenterAxis( void* sphere, Coord coord, double* disVec ) {
	Sphere*         self              = (Sphere*)sphere;
	Coord           newCoord;

	/* Transform coordinate into canonical reference frame */
	Stg_Shape_TransformCoord( self, coord, newCoord );

	disVec[0] = newCoord[ I_AXIS ];
	disVec[1] = newCoord[ J_AXIS ];
	if( self->dim == 3 )
		disVec[2] = newCoord[ K_AXIS ];
}
Ejemplo n.º 2
0
Bool _BelowPlane_IsCoordInside( void* belowPlane, Coord coord ) {
	BelowPlane*            self       = (BelowPlane*)belowPlane;
	Coord           newCoord;

	/* Transform coordinate into canonical reference frame */
	Stg_Shape_TransformCoord( self, coord, newCoord );

	if ( fabs( newCoord[ J_AXIS ] < self->offset ) ) {
		return True;
	}
	return False;
}
Ejemplo n.º 3
0
Bool _BelowCosinePlane_IsCoordInside( void* belowPlane, Coord coord ) {
	BelowCosinePlane*            self       = (BelowCosinePlane*)belowPlane;
	Coord                        newCoord;

	double                       x, y;

	/* Transform coordinate into canonical reference frame */
	Stg_Shape_TransformCoord( self, coord, newCoord );

	x = newCoord[ I_AXIS ];

	y = self->offset + self->delta * cos( ( self->radPeriod * x ) + self->phase );

	if ( fabs( newCoord[ J_AXIS ] < y) ) {
		return True;
	}
	return False;
}
Ejemplo n.º 4
0
Bool _Sphere_IsCoordInside( void* sphere, Coord coord ) {
	Sphere*         self              = (Sphere*)sphere;
	Coord           newCoord;
	double          insideOutsideValue;
	double          x, y, z;

	/* Transform coordinate into canonical reference frame */
	Stg_Shape_TransformCoord( self, coord, newCoord );

	x = newCoord[ I_AXIS ];
	y = newCoord[ J_AXIS ];
	if(self->dim == 2)
		insideOutsideValue = x*x + y*y;
	else {
		z = newCoord[ K_AXIS ];
		insideOutsideValue = x*x + y*y + z*z;
	}

	return (insideOutsideValue <= self->radiusSquared);
	
}