// ############################## START FUNC ############################################ // Integers: n,m, number_of_atoms // Floating numbers: temp_float // Floating number matrix: intramolecular_distance_matrix,x,y,z // Integer matrix: atom_sorts function intra_molecular_distances(atom_sorts, x,y,z) { var n=0; var m=0; var temp_float=0; // Any length of that for atom_sorts, x, y or z can of course be used var number_of_atoms = atom_sorts.length; // This command creates a number_of_atoms*number_of_atoms -matrix for atom interconnection distances var intramolecular_distance_matrix = def_matrix(number_of_atoms, number_of_atoms, 0, "undefined"); // ************ START LOOP (n) BELOW ********************* for(n=0;nm) temp_float=intramolecular_distance_matrix[m][n]; // If the matrix become to large, the function will return a blank value // Therefore, less accuracy is necessary to save memory intramolecular_distance_matrix[n][m]=Math.floor(temp_float*1000)/1000; } // ************ END OF LOOP (m) ABOVE ******************** } // ************ END OF LOOP (n) ABOVE ******************** return intramolecular_distance_matrix; } // ############################### end func ############################################