Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Linear Algebra and the C Language/a0p6

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

__NOTOC__ Install and compile this file in your working directory. /* ------------------------------------ */ /* Save as : c00d.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ #define RCA RC3 /* ------------------------------------ */ /* ------------------------------------ */ int main(void) { double a[RCA*RCA] ={ +2.363636363638, -1.909090909092, -0.272727272727, +1.818181818184, -1.545454545456, -0.363636363636, -0.909090909092, +1.272727272728, +1.181818181818 }; /* You can choose the value of the point P */ double P[RCA*C1] ={ +2, +5, +6, }; double **A = ca_A_mR(a, i_mR(RCA,RCA)); double **p = ca_A_mR(P, i_mR(RCA,C1)); double **Pp = mul_mR(A,p, i_mR(RCA,C1));; clrscrn(); printf(" A :"); p_mR(A, S9,P12, C4); printf(" You can choose the value of the point p\n\n" " p:"); p_mR(p, S9,P1, C4); printf(" The projection of p on the plan defined by v1 and v2.\n\n" " Pp: Copy this matrix into c00e.c"); P_mR(Pp, 18,P12, C4); stop(); f_mR(A); f_mR(p); f_mR(Pp); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ You can calculate the projection of a point P onto the plan. Screen output example: A : +2.363636363638 -1.909090909092 -0.272727272727 +1.818181818184 -1.545454545456 -0.363636363636 -0.909090909092 +1.272727272728 +1.181818181818 You can choose the value of the point p p: +2.0 +5.0 +6.0 The projection of p on the plan defined by v1 and v2. Pp: Copy this matrix into c00e.c -6.454545454546, -6.272727272728, +11.636363636364 Press return to continue.