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

📄 raymaths.h

📁 用于2维的射线追踪
💻 H
字号:
#ifndef __RAYMATHS_H__#define __RAYMATHS_H__#include <mesh/cellinfo.h>/* * Stephane Genaud.  * * temporary basic maths used for ray. Should move to * raydescartes maths file if it gets used a bit more. * *//** * -------------------------------------------------------------------- * cart_distance : given points c1 and c2 expressed as cartesian       * coordinates, return the distance between c1 and c2                 *-------------------------------------------------------------------- **/double cart_distance(struct coord_cart_t *c1, struct coord_cart_t *c2);/** * -------------------------------------------------------------------- * geo_distance : given points c1 and c2 expressed as geographic       * coordinates (angles in radians, depth=0 at surface), return the     * distance between c1 and c2 (units identical as the one used for     * depth)                                                              *-------------------------------------------------------------------- **/double geo_distance(struct coord_geo_t *g1, struct coord_geo_t *g2);/** *-------------------------------------------------------------------- * geo_middle : given points g1 and g2 expressed as geographic         * coordinates (angles are in radians), return the middle point of     * the segment [g1,g2] (units identical as the one used for depth)     *--------------------------------------------------------------------- **/struct coord_geo_t *geo_middle(struct coord_geo_t *g1, struct coord_geo_t *g2);struct coord_geo_t *geo_middleb(struct coord_geo_t *g1, struct coord_geo_t *g2);/** * cart2lin3D : given cartesian coordinates x,y,z, return a unique id  **/blocknum_t cart2lin3D(blocknum_t x,		   blocknum_t y,		   blocknum_t z,		   blocknum_t max_x,		   blocknum_t max_y) ;/** * lin2cart3d : given a unique id dest, updates the coordinates x,y,z  **/void lin2cart3D(blocknum_t dest,                blocknum_t *x,blocknum_t *y,blocknum_t *z,                blocknum_t max_x,blocknum_t max_y) ;int equal_z3(struct coord_z3_t p1, struct coord_z3_t p2);struct coord_cart_t * vector_minus_vector( struct coord_cart_t *v0, struct coord_cart_t *v1);struct coord_cart_t * vector_plus_vector( struct coord_cart_t *v0, struct coord_cart_t *v1);struct coord_cart_t * scal_prod(float k, struct coord_cart_t *v);struct coord_cart_t * vect_prod(struct coord_cart_t *c1, struct coord_cart_t* c2);/**   face_segment_intersect : computes the intersection point in Z^3    of a segment and a plane. **/int face_segment_intersect( struct coord_cart_t *s0,	                      struct coord_cart_t *s1,	                      struct coord_cart_t *p0,	                      struct coord_cart_t *n,   	                      struct coord_cart_t **i);int face_segment_intersect2(     struct coord_cart_t *p1,     struct coord_cart_t *p2,     struct coord_cart_t *pa,     struct coord_cart_t *pb,      struct coord_cart_t *pc,      struct coord_cart_t **i);      int face_segment_intersect3(     struct coord_cart_t *p1,     struct coord_cart_t *p2,       double r,     struct coord_cart_t **i);     int face_segment_intersect4(     struct coord_cart_t *p1,     struct coord_cart_t *p2,       double Beta,     struct coord_cart_t **i);     int face_segment_intersect5(     struct coord_cart_t *p1,     struct coord_cart_t *p2,       struct coord_cart_t **i);  #endif

⌨️ 快捷键说明

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