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

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" /* ------------------------------------ */ void fun(int r) { double **u = r_mR(i_mR(r,C1),9.); double **v = r_mR(i_mR(r,C1),9.); clrscrn(); printf(" u :"); p_mR(u,S3,P0,C6); printf(" v :"); p_mR(v,S3,P0,C6);; printf(" d(u,v) = ||u-v|| = (<u-v,u-v>)^1/2 \n\n"); printf(" d(u,v) = %.3f \n", dist_R(u,v)); printf(" d(v,u) = %.3f \n\n", dist_R(v,u)); f_mR(u); f_mR(v); } /* ------------------------------------ */ int main(void) { time_t t; srand(time(&t)); do { fun(rp_I(R3)+R2); } while(stop_w()); return 0; } /* ------------------------------------ */ /* ------------------------------------ */ Screen output example: u : -3 +1 -7 -8 +6 v : +2 +7 +6 +2 +6 d(u,v) = ||u-v|| = (<u-v,u-v>)^1/2 d(u,v) = 18.166 d(v,u) = 18.166 Press return to continue Press X return to stop