【お知らせ】この部分は英語原文のみでの提供となります。何卒ご了承ください。
2.1.18.7 ocmath_find_xy_in_circle
Contents
Description
Find how many points in the circle and their indices
Syntax
int ocmath_find_xy_in_circle( uint nPts, const double * pX, const double * pY, uint * pIndices, const double xc, const double yc, const double dRadius )
Parameters
- nPts
- [input]the size of pX and pY
- pX
- [input]pointer to array containing the x-coordinate;
- pY
- [input]pointer to array containing the y-coordinate;
- pIndices
- [output] the indexs of the points which are in the circle
- xc
- [input] the x-coordinate of the circle center
- yc
- [input] the y-coordinate of the circle center
- dRadius
- [input] the radius of the circle
Return
Returns number of points found.
Examples
EX1
#include <wks2mat.h> void ocmath_find_xy_in_circle_ex1() { uint nPts = 5; double pX[] = {-3.0, -2.0, 0.0, 1.0, 1.0}; double pY[] = {1.0, 0.0, 1.0, 1.0, 0.0}; uint pIndices[5]; int nRet = ocmath_find_xy_in_circle(nPts, pX, pY, pIndices, 0.0, 0.0, 2.0); out_int("nRet = ", nRet); out_str("The point in circle are:"); for(int ii = 0; ii < nRet; ii++) { printf("Point #%d: (%f, %f)\n",pIndices[ii], pX[pIndices[ii]], pY[pIndices[ii]]); } }
Remark
Should trim Missing Value before using this function
See Also
Header to Include
wks2mat.h