// ------- //
//  maths  //
// ------- //

// --------------- //
//  .. / geometry  //
// --------------- //

// ------------------------------ //
//  .. / .. / rectangular cuboid  //
// ------------------------------ //

function readme_rectangular_cuboid__readme_by_f_kromberg() {

	/* meta data:
	
	tree: maths / geometry / rectangular cuboid
	tags: rectangular cuboid, Quader (German)
	info: shows shape of rectangular cuboid
	date: 2023-09-19
	code: JS
	test: ok
	
	*/

	/*
	
	    -------------------------  
	   /                        /| 
	  / W         [A]          / | 
	 /            L           /  | 
	 -------------------------   | 
	 |                       |[B]| 
	 |                       |   / 
	 | H        [C]          |  /  
	 |                       | /   
	 |                       |/    
	 -------------------------     
	 
	*/
	
} // function

// ------------------ //
//  .. / .. / .. / 1  //
// ------------------ //

function get_lateral_area_of_rectangular_cuboid__function_by_f_kromberg( l, w, h ) {

	/* use:
	
	r = get_lateral_area_of_rectangular_cuboid( 
	
		l = 5, 
		w = 5,
		h = 5
		
	);
	
	*/

	/* meta data:
	
	tree: maths / geometry / rectangular cuboid / 1
	tags: rectangular cuboid, Quader (German)
	info: calculates lateral area of rectangular cuboid (German: Mantelflaeche eines Quaders)
	date: 2023-09-13
	code: JS
	test: ok
	
	*/
	
	var r = 2 * ( l + w ) * h;
	
	return r;

} // function

// ------------------ //
//  .. / .. / .. / 2  //
// ------------------ //

function get_lateral_area_plus_top_surface_of_rectangular_cuboid__function_by_f_kromberg( l, w, h ) {

	/* use:
	
	r = get_lateral_area_plus_top_surface_of_rectangular_cuboid( 
	
		l = 5, 
		w = 5,
		h = 5
		
	);
	
	*/

	/* meta data:
	
	tree: maths / geometry / rectangular cuboid / 2
	tags: rectangular cuboid, Quader (German)
	info: calculates lateral area plus top surface of rectangular cuboid (German: Mantelflaeche plus Deckflaeche eines Quaders)
	date: 2023-09-18
	code: JS
	test: ok
	
	*/
	
	var r = 2 * ( l + w ) * h + l * w;
	
	return r;

} // function

// ------------------ //
//  .. / .. / .. / 3  //
// ------------------ //

function get_surface_of_rectangular_cuboid__function_by_f_kromberg( l, w, h ) {

	/* use:
	
	r = get_surface_of_rectangular_cuboid( 
	
		l = 5, 
		w = 5,
		h = 5
		
	);
	
	*/

	/* meta data:
	
	tree: maths / geometry / rectangular cuboid / 3
	tags: rectangular cuboid, Quader (German)
	info: calculates surface of rectangular cuboid (German: Oberflaeche eines Quaders)
	date: 2023-09-18
	code: JS
	test: ok
	
	*/
	
	var r = 2 * ( l * w + l * h + w * h );
	
	return r;

} // function

// ------------------ //
//  .. / .. / .. / 4  //
// ------------------ //

function get_volume_of_rectangular_cuboid__function_by_f_kromberg( l, w, h ) {

	/* use:
	
	r = get_volume_of_rectangular_cuboid( 
	
		l = 5, 
		w = 5,
		h = 5
		
	);
	
	*/

	/* meta data:
	
	tree: maths / geometry / rectangular cuboid / 4
	tags: rectangular cuboid, Quader (German)
	info: calculates volume of rectangular cuboid (German: Volumen eines Quaders)
	date: 2023-09-18
	code: JS
	test: ok
	
	*/
	
	var r = l * w * h;
	
	return r;

} // function

// ---------- //
//  printing  //
// ---------- //

// --------- //
//  ... / 1  //
// --------- //

// ------------------- //
//  ... / ... / parts  //
// ------------------- //

// --------------------- //
//  ... / ... / ... / 1  //
// --------------------- //

function get_br__function_by_f_kromberg() {

	/* use:
	
	var br = get_br__function_by_f_kromberg();
	
	*/
	
	/* meta data:
	
	tree: printing / 1 / parts / 1
	tags: printing, string, br
	info: get br string
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var str = "<br>";
	
	return str;

} // function

function get_n__function_by_f_kromberg() {

	/* use:
	
	var n = get_n__function_by_f_kromberg();
	
	*/
	
	/* meta data:
	
	tree: printing / 1 / parts / 1
	tags: printing, string, n
	info: get n string
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var str = "\n";
	
	return str;

} // function

// --------------------- //
//  ... / ... / ... / 2  //
// --------------------- //

function get_text_br__function_by_f_kromberg( text ) {

	/* use:
	
	var str = get_text_br__function_by_f_kromberg( text = "" );
	
	*/
	
	/* meta data:
	
	tree: printing / 1 / parts / 2
	tags: printing, string, br
	info: get text + br string
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var br = get_br__function_by_f_kromberg();
	var str = text + br;
	
	return str;

} // function

function get_text_br_n__function_by_f_kromberg( text ) {

	/* use:
	
	var str = get_text_br_n__function_by_f_kromberg( text = "" );
	
	*/
	
	/* meta data:
	
	tree: printing / 1 / parts / 2
	tags: printing, string, br, n
	info: get text + br + n string
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var str = get_text_br__function_by_f_kromberg( text );
	var n = get_n__function_by_f_kromberg();
	
	str += n;
	
	return str;

} // function

function get_text_n__function_by_f_kromberg( text ) {

	/* use:
	
	var str = get_text_n__function_by_f_kromberg( text = "" );
	
	*/
	
	/* meta data:
	
	tree: printing / 1 / parts / 2
	tags: printing, string, n
	info: get text + n string
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var n = get_n__function_by_f_kromberg();
	var str = text + n;
	
	return str;

} // function

// -------------------------------- //
//  ... / ... / ... / compilations  //
// -------------------------------- //

// --------------------------- //
//  ... / ... / ... / ... / 1  //
// --------------------------- //

function get_array_printing_string__function_by_f_kromberg( ar, nr_bool ) {

	/* use:
	
	var str = get_array_printing_string__function_by_f_kromberg( 
	
		ar      = [ 1, 2, 3 ],
		nr_bool = true
		
	);
	
	*/
	
	/* meta data:
	
	tree: printing / 1 / parts / compilations / 1
	tags: printing, array
	info: get array string
	date: 2023-09-26
	code: JS
	test: ok
	
	*/

	var l = ar.length;
	
	var i, j, el;
	var str = "";
	var nr_post = ": ";
	
	for ( i=0; i<l; i++ ) {
	
		j = i + 1;
		
		el = ar[i];
		
		if ( nr_bool ) str += j + nr_post;
		
		str += el;
		
	} // for
	
	return str;

} // function

// --------------------------- //
// ... / ... / ... /  ... / 2  //
// --------------------------- //

function get_array_br_n_printing_string__function_by_f_kromberg( ar, nr_bool ) {

	/* use:
	
	var str = get_array_br_n_printing_string__function_by_f_kromberg( 
	
		ar      = [ 1, 2, 3 ],
		nr_bool = true
		
	);
	
	*/
	
	/* meta data:
	
	tree: printing / 1 / parts / compilations / 2
	tags: printing, array, br, n
	info: get array + br + n string
	date: 2023-09-26
	code: JS
	test: ok
	
	*/

	var l = ar.length;
	
	var i, j, el;
	var str = "";
	var nr_post = ": ";
	
	var br = get_br__function_by_f_kromberg();
	var n = get_n__function_by_f_kromberg();
	
	for ( i=0; i<l; i++ ) {
	
		j = i + 1;
		
		el = ar[i];
		
		if ( nr_bool ) str += j + nr_post;
		
		str += el + br + n;
		
	} // for
	
	return str;

} // function

function get_array_br_printing_string__function_by_f_kromberg( ar, nr_bool ) {

	/* use:
	
	var str = get_array_br_printing_string__function_by_f_kromberg( 
	
		ar      = [ 1, 2, 3 ],
		nr_bool = true
		
	);
	
	*/
	
	/* meta data:
	
	tree: printing / 1 / parts / compilations / 2
	tags: printing, array, br
	info: get array + br string
	date: 2023-09-26
	code: JS
	test: ok
	
	*/

	var l = ar.length;
	
	var i, j, el;
	var str = "";
	var nr_post = ": ";
	
	var br = get_br__function_by_f_kromberg();
	
	for ( i=0; i<l; i++ ) {
	
		j = i + 1;
		
		el = ar[i];
		
		if ( nr_bool ) str += j + nr_post;
		
		str += el + br;
		
	} // for
	
	return str;

} // function

function get_array_n_printing_string__function_by_f_kromberg( ar, nr_bool ) {

	/* use:
	
	var str = get_array_n_printing_string__function_by_f_kromberg( 
	
		ar      = [ 1, 2, 3 ],
		nr_bool = true
		
	);
	
	*/
	
	/* meta data:
	
	tree: printing / 1 / parts / compilations / 2
	tags: printing, array, n
	info: get array + n string
	date: 2023-09-26
	code: JS
	test: ok
	
	*/

	var l = ar.length;
	
	var i, j, el;
	var str = "";
	var nr_post = ": ";
	
	var n = get_n__function_by_f_kromberg();
	
	for ( i=0; i<l; i++ ) {
	
		j = i + 1;
		
		el = ar[i];
		
		if ( nr_bool ) str += j + nr_post;
		
		str += el + n;
		
	} // for
	
	return str;

} // function

// ---------------------------- //
//  ... / ... / ... /  ... / 3  //
// ---------------------------- //

function get_array_char_printing_string__function_by_f_kromberg( ar, cha, nr_bool ) {

	/* use:
	
	var str = get_array_char_printing_string__function_by_f_kromberg( 
	
		ar      = [ 1, 2, 3 ],
		cha     = ",",
		nr_bool = true
		
	);
	
	*/
	
	/* meta data:
	
	tree: printing / 1 / parts / compilations / 3
	tags: printing, array, char
	info: get array + char
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var l = ar.length;
	
	var i, j, el, cha_2;
	var str = "";
	
	for ( i=0; i<l; i++ ) {
	
		j = i + 1;
		
		el = ar[i];
		
		if ( i > 0 ) cha_2 = cha + " "; // e.g. ", "
		else         cha_2 = "";
		
		str += cha_2;
		str += el;
		
		if ( nr_bool ) str += " (" + j + ".)"; // e.g. "(1)"
		
	} // for
	
	return str;

} // function

function get_array_comma_printing_string__function_by_f_kromberg( ar, nr_bool ) {

	/* use:
	
	var str = get_array_comma_printing_string__function_by_f_kromberg( 
	
		ar      = [ 1, 2, 3 ],
		nr_bool = true
		
	);
	
	*/
	
	/* meta data:
	
	tree: printing / 1 / parts / compilations / 3
	tags: printing, array, comma
	info: get array + comma
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var l = ar.length;
	
	var cha = ",";
	var i, j, el, cha_2;
	var str = "";
	
	for ( i=0; i<l; i++ ) {
	
		j = i + 1;
		
		el = ar[i];
		
		if ( i > 0 ) cha_2 = cha + " "; // e.g. ", "
		else         cha_2 = "";
		
		str += cha_2;
		str += el;
		
		if ( nr_bool ) str += " (" + j + ".)"; // e.g. "(1)"
		
	} // for
	
	return str;

} // function

// --------- //
//  ... / 2  //
// --------- //

// ------------------- //
//  ... / ... / print  //
// ------------------- //

// --------------------- //
//  ... / ... / ... / 1  //
// --------------------- //

function print_text__procedure_by_f_kromberg( text ) {

	/* use:
	
	print_text__procedure_by_f_kromberg( text = "" );
	
	*/
	
	/* meta data:
	
	tree: printing / 2 / print / 1
	tags: printing, string
	info: print text
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	document.write( text );

} // function

// --------------------- //
//  ... / ... / ... / 2  //
// --------------------- //

function print_br__procedure_by_f_kromberg() {

	/* use:
	
	var br = print_br__procedure_by_f_kromberg();
	
	*/
	
	/* meta data:
	
	tree: printing / 2 / print / 2
	tags: printing, string, br
	info: print br
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var br = get_br__function_by_f_kromberg();
	
	print_text__procedure_by_f_kromberg( br );

} // function

function print_n__procedure_by_f_kromberg() {

	/* use:
	
	print_n__procedure_by_f_kromberg();
	
	*/
	
	/* meta data:
	
	tree: printing / 2 / print / 2
	tags: printing, string, n
	info: print n
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var n = get_n__function_by_f_kromberg();
	
	print_text__procedure_by_f_kromberg( n );

} // function

// --------------------- //
//  ... / ... / ... / 3  //
// --------------------- //

function print_text_br__procedure_by_f_kromberg( text ) {

	/* use:
	
	print_text_br__procedure_by_f_kromberg( text = "" );
	
	*/
	
	/* meta data:
	
	tree: printing / 2 / print / 3
	tags: printing, string, br
	info: print text + br
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var str = get_text_br__function_by_f_kromberg( text );

	print_text__procedure_by_f_kromberg( str );

} // function

function print_text_br_n__procedure_by_f_kromberg( text ) {

	/* use:
	
	print_text_br_n__procedure_by_f_kromberg( text = "" );
	
	*/
	
	/* meta data:
	
	tree: printing / 2 / print / 3
	tags: printing, string, br, n
	info: print text + br + n
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var str = get_text_br_n__function_by_f_kromberg( text );

	print_text__procedure_by_f_kromberg( str );

} // function

function print_text_n__procedure_by_f_kromberg( text ) {

	/* use:
	
	print_text_n__procedure_by_f_kromberg( text = "" );
	
	*/
	
	/* meta data:
	
	tree: printing / 2 / print / 3
	tags: printing, string, n
	info: print text + n
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var str = get_text_n__function_by_f_kromberg( text );
	
	print_text__procedure_by_f_kromberg( str );

} // function

// -------------------------------- //
//  ... / ... / ... / compilations  //
// -------------------------------- //

// --------------------------- //
//  ... / ... / ... / ... / 1  //
// --------------------------- //

function print_array__procedure_by_f_kromberg( ar, nr_bool ) {

	/* use:
	
	print_array__procedure_by_f_kromberg(
	
		ar      = [ 1, 2, 3 ],
		nr_bool = true
		
	);
	
	*/
	
	/* meta data:
	
	tree: printing / 2 / print / compilations / 1
	tags: printing, array
	info: print array
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var str = get_array_printing_string__function_by_f_kromberg( ar, nr_bool );
	
	print_text__procedure_by_f_kromberg( str );

} // function

// --------------------------- //
//  ... / ... / ... / ... / 2  //
// --------------------------- //

function print_array_br__procedure_by_f_kromberg( ar, nr_bool ) {

	/* use:
	
	print_array_br__procedure_by_f_kromberg(
	
		ar      = [ 1, 2, 3 ],
		nr_bool = true
		
	);
	
	*/
	
	/* meta data:
	
	tree: printing / 2 / print / compilations / 2
	tags: printing, array, br
	info: print array + br
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var str = get_array_br_printing_string__function_by_f_kromberg( ar, nr_bool );
	
	print_text__procedure_by_f_kromberg( str );

} // function

function print_array_br_n__procedure_by_f_kromberg( ar, nr_bool ) {

	/* use:
	
	print_array_br_n__procedure_by_f_kromberg(
	
		ar = [ 1, 2, 3 ],
		nr_bool = true
		
	);
	
	*/
	
	/* meta data:
	
	tree: printing / 2 / print / compilations / 2
	tags: printing, array, br, n
	info: print array + br + n
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var str = get_array_br_n_printing_string__function_by_f_kromberg( ar, nr_bool );
	
	print_text__procedure_by_f_kromberg( str );

} // function

function print_array_n__procedure_by_f_kromberg( ar, nr_bool ) {

	/* use:
	
	print_array_n__procedure_by_f_kromberg(
	
		ar      = [ 1, 2, 3 ],
		nr_bool = true
		
	);
	
	*/
	
	/* meta data:
	
	tree: printing / 2 / print / compilations / 2
	tags: printing, array, n
	info: print array + n
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var str = get_array_n_printing_string__function_by_f_kromberg( ar, nr_bool );
	
	print_text__procedure_by_f_kromberg( str );

} // function

// --------------------------- //
//  ... / ... / ... / ... / 3  //
// --------------------------- //

function print_array_char__procedure_by_f_kromberg( ar, cha, nr_bool ) {

	/* use:
	
	print_array_char__procedure_by_f_kromberg(
	
		ar      = [ 1, 2, 3 ],
		cha     = ",",
		nr_bool = true
		
	);
	
	*/
	
	/* meta data:
	
	tree: printing / 2 / print / compilations / 3
	tags: printing, array, char
	info: print array + char
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var str = get_array_char_printing_string__function_by_f_kromberg( ar, cha, nr_bool );
	
	print_text__procedure_by_f_kromberg( str );

} // function

function print_array_comma__procedure_by_f_kromberg( ar, nr_bool ) {

	/* use:
	
	print_array_comma__procedure_by_f_kromberg(
	
		ar      = [ 1, 2, 3 ],
		nr_bool = true
		
	);
	
	*/
	
	/* meta data:
	
	tree: printing / 2 / print / compilations / 3
	tags: printing, array, comma
	info: print array + comma
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var str = get_array_comma_printing_string__function_by_f_kromberg( ar, nr_bool );
	
	print_text__procedure_by_f_kromberg( str );

} // function

// --------------------------- //
//  ... / ... / ... / ... / 4  //
// --------------------------- //

function print_array_std__procedure_by_f_kromberg( ar ) {

	/* use:
	
	print_array_std__procedure_by_f_kromberg( ar = [ 1, 2, 3 ] );
	
	*/
	
	/* meta data:
	
	tree: printing / 2 / print / compilations / 4
	tags: printing, array, std
	info: print array std
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	print_array_br_n__procedure_by_f_kromberg(
	
		ar,
		nr_bool = true
		
	);

} // function

// --------- //
//  ... / 3  //
// --------- //

// -------------------------- //
//  ... / ... / print tables  //
// -------------------------- //

function print_array_table__procedure_by_f_kromberg( ar, nr_bool ) {

	/* use:
	
	print_array_table__procedure_by_f_kromberg(
	
		ar      = [ 1, 2, 3 ],
		nr_bool = true
		
	);
	
	*/
	
	/* meta data:
	
	tree: printing / 3 / print tables
	tags: printing, array
	info: print array
	date: 2023-09-26
	code: JS
	test: ok
	
	*/
	
	var l = ar.length;
	
	var i, j, el;
	var str = "";
	var n = get_n__function_by_f_kromberg();
	
	str += "<table>" + n;
	
	for ( i=0; i<l; i++ ) {
	
		j = i + 1;
		
		el = ar[i];
		
		str += "<tr>" + n;
		
		if ( nr_bool ) {
		
			str += "<td>";
			str += "<em>";
			str += j + ".";
			str += "</em>";
			str += "</td>" + n;
			
		} // if
		
		str += "<td>";
		str += el;
		str += "</td>" + n;
		
		str += "</tr>" + n;
		
	} // for
	
	str += "</table>" + n;
	
	print_text__procedure_by_f_kromberg( str );

} // function