* This routine computes the feature parameters which describe * the micro-feature that starts and Start and ends at End. * A new micro-feature is allocated, filled with the feature * parameters, and returned. The routine assumes that * Start and End are not the same point. If they are the * same point, NULL is returned, a warning message is * printed, and the current outline is dumped to s
| 181 | * - 11/17/89, DSJ, Added handling for Start and End same point. |
| 182 | */ |
| 183 | MICROFEATURE ExtractMicroFeature(MFOUTLINE Start, MFOUTLINE End) { |
| 184 | MICROFEATURE NewFeature; |
| 185 | MFEDGEPT *P1, *P2; |
| 186 | |
| 187 | P1 = PointAt(Start); |
| 188 | P2 = PointAt(End); |
| 189 | |
| 190 | NewFeature = NewMicroFeature (); |
| 191 | NewFeature[XPOSITION] = AverageOf(P1->Point.x, P2->Point.x); |
| 192 | NewFeature[YPOSITION] = AverageOf(P1->Point.y, P2->Point.y); |
| 193 | NewFeature[MFLENGTH] = DistanceBetween(P1->Point, P2->Point); |
| 194 | NewFeature[ORIENTATION] = NormalizedAngleFrom(&P1->Point, &P2->Point, 1.0); |
| 195 | NewFeature[FIRSTBULGE] = 0.0f; // deprecated |
| 196 | NewFeature[SECONDBULGE] = 0.0f; // deprecated |
| 197 | |
| 198 | return NewFeature; |
| 199 | } /* ExtractMicroFeature */ |
no test coverage detected