Skip to content
Simple C++ program for basic geometry
C++ C
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
comp_geo.cc
comp_geo.h

README.md

Computational Geometry Library

C++ program for performing computational geometry on circles and rectangles. My functions take in parameters which represent points on the shapes. My program can find circumference, area, perimeter, the distance between two points, and the distance squared between two points. The distance squared function is necessary to make finding the area of the circle more efficient.

GetCircumference/GetArea:

  • xc: x-value of circle's center
  • yx: y-value of circle's center
  • xe: x-value of a point on the circle
  • ye: y-value of the same point on the circle

GetPerimeter:

  • xu: x-value of lower-left point on rectangle
  • yu: y-value of lower-left point on rectangle
  • xur: x-value of upper-right point on rectangle
  • yur: y-value of upper right point on rectangle

GetDistanceSquared/GetDistance

  • x1: x-value of point 1
  • y1: y-value of point 1
  • x2: x-value of point 2
  • y2: y-value of point 2
You can’t perform that action at this time.