Skip to content

Commit e871991

Browse files
Homer Reidstevengj
authored andcommitted
update console-printed description of prism to include center and report axis in cartesian (not prism) coordinate system (#22)
1 parent 0e88f44 commit e871991

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

utils/geom.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2482,10 +2482,11 @@ void display_prism_info(int indentby, prism *prsm)
24822482
int num_vertices = prsm->vertices.num_items;
24832483
double height = prsm->height;
24842484
vector3 z0 = {0.0, 0.0, 1.0};
2485-
vector3 axis = matrix3x3_vector3_mult(prsm->m_c2p,z0);
2485+
vector3 axis = prism_vector_p2c(prsm,z0);
2486+
vector3 center = prism_coordinate_p2c(prsm,vector3_scale(0.5*height,z0));
24862487

2487-
printf("%*s height %g, axis (%g,%g,%g), %i vertices:\n", indentby, "",
2488-
height, axis.x, axis.y, axis.z, num_vertices);
2488+
printf("%*s height %g, axis (%g,%g,%g), center (%g,%g,%g), %i vertices:\n",
2489+
indentby, "", height,axis.x,axis.y,axis.z,center.x,center.y,center.z,num_vertices);
24892490
matrix3x3 m_p2c = matrix3x3_inverse(prsm->m_c2p);
24902491
int nv;
24912492
for(nv=0; nv<num_vertices; nv++)

0 commit comments

Comments
 (0)