⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fttrigon.h

📁 一个类似windows
💻 H
📖 第 1 页 / 共 2 页
字号:

  /*************************************************************************/
  /*                                                                       */
  /* @function:                                                            */
  /*    FT_Atan2                                                           */
  /*                                                                       */
  /* @description:                                                         */
  /*    Return the arc-tangent corresponding to a given vector (x,y) in    */
  /*    the 2d plane.                                                      */
  /*                                                                       */
  /* @input:                                                               */
  /*    x :: The horizontal vector coordinate.                             */
  /*                                                                       */
  /*    y :: The vertical vector coordinate.                               */
  /*                                                                       */
  /* @return:                                                              */
  /*    The arc-tangent value (i.e. angle).                                */
  /*                                                                       */
  FT_EXPORT( FT_Angle )
  FT_Atan2( FT_Fixed  x,
            FT_Fixed  y );


  /*************************************************************************/
  /*                                                                       */
  /* @function:                                                            */
  /*    FT_Angle_Diff                                                      */
  /*                                                                       */
  /* @description:                                                         */
  /*    Return the difference between two angles.  The result is always    */
  /*    constrained to the ]-PI..PI] interval.                             */
  /*                                                                       */
  /* @input:                                                               */
  /*    angle1 :: First angle.                                             */
  /*                                                                       */
  /*    angle2 :: Second angle.                                            */
  /*                                                                       */
  /* @return:                                                              */
  /*    Contrainted value of `value2-value1'.                              */
  /*                                                                       */
  FT_EXPORT( FT_Angle )
  FT_Angle_Diff( FT_Angle  angle1,
                 FT_Angle  angle2 );


  /*************************************************************************/
  /*                                                                       */
  /* @function:                                                            */
  /*    FT_Vector_Unit                                                     */
  /*                                                                       */
  /* @description:                                                         */
  /*    Return the unit vector corresponding to a given angle.  After the  */
  /*    call, the value of `vec.x' will be `sin(angle)', and the value of  */
  /*    `vec.y' will be `cos(angle)'.                                      */
  /*                                                                       */
  /*    This function is useful to retrieve both the sinus and cosinus of  */
  /*    a given angle quickly.                                             */
  /*                                                                       */
  /* @output:                                                              */
  /*    vec   :: The address of target vector.                             */
  /*                                                                       */
  /* @input:                                                               */
  /*    angle :: The address of angle.                                     */
  /*                                                                       */
  FT_EXPORT( void )
  FT_Vector_Unit( FT_Vector*  vec,
                  FT_Angle    angle );


  /*************************************************************************/
  /*                                                                       */
  /* @function:                                                            */
  /*    FT_Vector_Rotate                                                   */
  /*                                                                       */
  /* @description:                                                         */
  /*    Rotate a vector by a given angle.                                  */
  /*                                                                       */
  /* @inout:                                                               */
  /*    vec   :: The address of target vector.                             */
  /*                                                                       */
  /* @input:                                                               */
  /*    angle :: The address of angle.                                     */
  /*                                                                       */
  FT_EXPORT( void )
  FT_Vector_Rotate( FT_Vector*  vec,
                    FT_Angle    angle );


  /*************************************************************************/
  /*                                                                       */
  /* @function:                                                            */
  /*   FT_Vector_Length                                                    */
  /*                                                                       */
  /* @description:                                                         */
  /*   Return the length of a given vector.                                */
  /*                                                                       */
  /* @input:                                                               */
  /*   vec :: The address of target vector.                                */
  /*                                                                       */
  /* @return:                                                              */
  /*   The vector length, expressed in the same units that the original    */
  /*   vector coordinates.                                                 */
  /*                                                                       */
  FT_EXPORT( FT_Fixed )
  FT_Vector_Length( FT_Vector*  vec );


  /*************************************************************************/
  /*                                                                       */
  /* @function:                                                            */
  /*    FT_Vector_Polarize                                                 */
  /*                                                                       */
  /* @description:                                                         */
  /*    Compute both the length and angle of a given vector.               */
  /*                                                                       */
  /* @input:                                                               */
  /*    vec    :: The address of source vector.                            */
  /*                                                                       */
  /* @output:                                                              */
  /*    length :: The vector length.                                       */
  /*    angle  :: The vector angle.                                        */
  /*                                                                       */
  FT_EXPORT( void )
  FT_Vector_Polarize( FT_Vector*  vec,
                      FT_Fixed   *length,
                      FT_Angle   *angle );


  /*************************************************************************/
  /*                                                                       */
  /* @function:                                                            */
  /*    FT_Vector_From_Polar                                               */
  /*                                                                       */
  /* @description:                                                         */
  /*    Compute vector coordinates from a length and angle.                */
  /*                                                                       */
  /* @output:                                                              */
  /*    vec    :: The address of source vector.                            */
  /*                                                                       */
  /* @input:                                                               */
  /*    length :: The vector length.                                       */
  /*    angle  :: The vector angle.                                        */
  /*                                                                       */
  FT_EXPORT( void )
  FT_Vector_From_Polar( FT_Vector*  vec,
                        FT_Fixed    length,
                        FT_Angle    angle );

  /* */


FT_END_HEADER

#endif /* __FTTRIGON_H__ */


/* END */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -