# HELP determining Shape drawn by mouse?!

**URL:** <https://forum.kirupa.com/t/help-determining-shape-drawn-by-mouse/325776>\
**Category:** programming\
**Created:** [November 3, 2011, 9:07pm UTC](https://forum.kirupa.com/t/help-determining-shape-drawn-by-mouse/325776 "2011-11-03T21:07:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ubergoten](https://avatars.discourse-cdn.com/v4/letter/u/dec6dc/32.png) [@ubergoten](https://forum.kirupa.com/u/ubergoten)\
**Post date:** [November 3, 2011, 9:07pm UTC](https://forum.kirupa.com/t/help-determining-shape-drawn-by-mouse/325776/1 "2011-11-03T21:07:40Z")

</div>

Hey everyone,

I’m stumped on this. I’m trying to figure out how to determine the shape drawn my a person after mouse\_down event has been thrown. Currently I have an array that stores the points including the initial MOUSE\_DOWN point as well as a point every 0.2 seconds until MOUSE\_RELEASE then it records that point as well.

I’m trying to determine the shape drawn with a bunch of math. My initial test was to determine a circle using 4 vector points A, B, C, and D then I calculated AB, AC, DC, BD, CD, DA

and with help of the dot product i did: AB . CD + BC . DA = AC . BD

if the absolute values are equal then the points lie within a circle together… which works- but that also screws up a bunch of the other draw patterns like a basic line or something because it would fit as well…

I’m wondering if I’m on the right track… completely off track or what- Any help would be awesome!! If this is right I guess I could just do an if/else statement or whatever, with this option at the bottom to check all the others beforehand… Thoughts?

THANKS EVERYONE!!
