<commit_before>package games.math

object Utils {
  val degToRadFactor: Float = (Math.PI / 180.0).toFloat
  val radToDegFactor: Float = (180.0 / Math.PI).toFloat

  def degToRad(deg: Float): Float = {
    deg * degToRadFactor
  }

  def radToDeg(rad: Float): Float = {
    rad * radToDegFactor
  }

  def cotan(v: Double): Double = {
    1.0 / Math.tan(v)
  }

  def orthogonalize(mat: Matrix3f): Unit = {
    val r1 = mat.column(0)
    val r2 = mat.column(1)
    val r3 = mat.column(2)

    r1.normalise()

    val newR2 = r2 - r1 * (r1 * r2)
    newR2.normalise()

    val newR3 = r1.cross(newR2)
    newR3.normalise()

    // TODO
  }

}<commit_msg>Completed orthogonalize method<commit_after>package games.math

object Utils {
  val degToRadFactor: Float = (Math.PI / 180.0).toFloat
  val radToDegFactor: Float = (180.0 / Math.PI).toFloat

  def degToRad(deg: Float): Float = {
    deg * degToRadFactor
  }

  def radToDeg(rad: Float): Float = {
    rad * radToDegFactor
  }

  def cotan(v: Double): Double = {
    1.0 / Math.tan(v)
  }

  def orthogonalize(mat: Matrix3f): Unit = {
    val r1 = mat.column(0)
    val r2 = mat.column(1)
    val r3 = mat.column(2)

    r1.normalise()

    val newR2 = r2 - r1 * (r1 * r2)
    newR2.normalise()

    val newR3 = r1.cross(newR2)
    newR3.normalise()

    Matrix3f.setColumn(r1, mat, 0)
    Matrix3f.setColumn(newR2, mat, 1)
    Matrix3f.setColumn(newR3, mat, 2)
  }

}
{'fraction_non_alphanumeric': 0.1359154929577465, 'fraction_numerical': 0.045774647887323945, 'mean_word_length': 2.6157760814249365, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5824489', 'n_tokens_mistral': 613, 'n_tokens_neox': 570, 'n_words': 126}