2

## 資料型態問題(新手)

``````trackerOpFinal[tk].x = (int16_t) (obj->trackerState[ik].vec[iX]*oneQFormat); //X坐標
trackerOpFinal[tk].y = (int16_t) (obj->trackerState[ik].vec[iY]*oneQFormat);//Y坐標
trackerOpFinal[tk].xd = (int16_t) (obj->trackerState[ik].vec[iXd]*oneQFormat);//X速度向量
trackerOpFinal[tk].yd = (int16_t) (obj->trackerState[ik].vec[iYd]*oneQFormat);//Y速度向量
trackerOpFinal[tk].xSize        =  obj->trackerState[ik].xSize;//X尺寸
trackerOpFinal[tk].ySize        =  obj->trackerState[ik].ySize;//Y尺寸
``````

``````if( 0xEC00 < (int16_t) (obj->trackerState[ik].vec[iYd]*oneQFormat) < 0xFF00)
{
trackerOpFinal[tk].x = (int16_t) (obj->trackerState[ik].vec[iX]*oneQFormat);
trackerOpFinal[tk].y = (int16_t) (obj->trackerState[ik].vec[iY]*oneQFormat);
trackerOpFinal[tk].xd = (int16_t) (obj->trackerState[ik].vec[iXd]*oneQFormat);
trackerOpFinal[tk].yd = (int16_t) (obj->trackerState[ik].vec[iYd]*oneQFormat);
trackerOpFinal[tk].xSize        =  obj->trackerState[ik].xSize;
trackerOpFinal[tk].ySize        =  obj->trackerState[ik].ySize;

tk++;
}
``````

### 1 個回答

3

iT邦大神 1 級 ‧ 2021-10-27 16:17:11

``````if( 0xEC00 < (int16_t) (obj->trackerState[ik].vec[iYd]*oneQFormat) < 0xFF00)
{
``````

``````if ((0xEC00<(int16_t)(obj->trackerState[ik].vec[iYd]*oneQFormat))&&((int16_t)(obj->trackerState[ik].vec[iYd]*oneQFormat)<0xFF00))
{
``````