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/a0a4

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 : c00c.c */ /* ------------------------------------ */ #include "v_a.h" /* ------------------------------------ */ void fun(int r) { double **u = r_mR(i_mR(r,C1),9.); double **n_u = i_mR(r,C1); clrscrn(); printf(" u :"); p_mR(u,S3,P0,C6); smul_mR(1./norm_R(u),u,n_u); printf(" n_u = (1/||u||) u :"); p_mR(n_u,S3,P6,C6); printf(" ||n_u|| = %.10f \n\n", norm_R(n_u)); f_mR(u); f_mR(n_u); } /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); do { fun(rp_I(R3)+R2); } while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: u : +2 +4 +2 -5 n_u = (1/||u||) u : +0.285714 +0.571429 +0.285714 -0.714286 ||n_u|| = 1.0000000000 Press return to continue Press X return to stop