Announcement

Collapse
No announcement yet.

Geometry Functions

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #46
    @Baker - I love it bro. That's the "signature" of a man that is " 'bout to make some S#it".

    Have you actually written all the methods for those definitions or is that more like a wish list (currently)? If it's the former - damn, that must be thousands of lines of processes.
    Last edited by MadGypsy; 02-24-2012, 12:08 AM.
    http://www.nextgenquake.com

    Comment


    • #47
      Code:
      float Circle_Arc_Length_From_Radius_And_Radians (const float radius, const float radians)
      {
      	const float degrees = RADIANS_TO_DEGREES(radians);
      	
      	return Circle_Arc_Length_From_Radius_And_Degrees (radius, degrees);
      }
      
      float Circle_Arc_Length_From_Radius_And_Degrees (const float radius, const float degrees)
      {
      	const float circumference	= Circle_Circumference_From_Radius (radius);
      	const float percent			= Circle_Sector_Percent_From_Degrees (degrees);
      	
      	return circumference * percent;
      }
      
      float Circle_Chord_Length_From_Radians_And_Radius (const float radians, const float radius)
      {
      	const float x1		= radius;
      	const float y1		= 0;
      	const float x2		= cosf (radians);
      	const float y2		= sinf (radians);
      
      	return Line_Segment_Length_From_Points (x1, y1, x2, y2);
      }
      
      
      float Circle_Arc_Length_From_Chord_Length_And_Degrees (const float chordlength, const float degrees)
      {
      	const float radius = Circle_Radius_From_Chord_Length_And_Degrees(chordlength, degrees);
      	return Circle_Arc_Length_From_Radius_And_Degrees(radius, degrees);
      }
      
      float Circle_Chord_Length_From_Degrees_And_Radius (const float degrees, const float radius)
      {
      	const float radians	= DEGREES_TO_RADIANS (degrees);
      	
      	return Circle_Chord_Length_From_Radians_And_Radius (radians, radius);
      }
      
      .
      .
      .
      Quakeone.com - Being exactly one-half good and one-half evil has advantages. When a portal opens to the antimatter universe, my opposite is just me with a goatee.

      So while you guys all have to fight your anti-matter counterparts, me and my evil twin will be drinking a beer laughing at you guys ...

      Comment

      Working...
      X