473,503 Members | 1,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Polygons, Shapes

Whats the easiest way of defining a shape
and knowing if a point is with in it?

parden the crude pseduocode...
i want something like:

Shape1 = p1,p2,p3,p4,p5,p6,p7,p8,p9,p10

pnt = x,y

if (shape1 containes(pnt)) {

}

Anyone know of something like this?

Pete
Jul 19 '05 #1
2 2420
On Wed, 27 Aug 2003 23:04:32 GMT, "Pete" <p_*********@comcast.net> wrote:
Whats the easiest way of defining a shape
Try using a std::vector for the points.

and knowing if a point is with in it?

parden the crude pseduocode...
i want something like:

Shape1 = p1,p2,p3,p4,p5,p6,p7,p8,p9,p10

pnt = x,y

if (shape1 containes(pnt)) {

}

Anyone know of something like this?


What's the C++ question?

<ot>
E.g. count the number of crossing for a line through the point, or
walk the perimeter of the shape and check the direction to the point.
</ot>
Jul 19 '05 #2
Pete wrote:
Whats the easiest way of defining a shape
and knowing if a point is with in it?

parden the crude pseduocode...
i want something like:

Shape1 = p1,p2,p3,p4,p5,p6,p7,p8,p9,p10

pnt = x,y

if (shape1 containes(pnt)) {

}

Anyone know of something like this?

Pete


This is question 2.03 of the comp.graphics.algorithms FAQ.

http://www.exaflop.org/docs/cgafaq/ind.html

-Peter

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2040
by: David | last post by:
i am using the imagepolygon function to create a shape on an image i have, however i want to put more than just one polygon onto this image, i have no idea how to do this. Do i have to call the...
1
3332
by: smjmitchell | last post by:
Hi All, I am developing a application in VB 6.0. I need to plot a 3D mesh of quadrilateral and triangular polygons. I have this working OK in wireframe. The question I have is what is the...
6
5153
by: Kristian Frost | last post by:
Hi, I'm trying to add, as you might guess, mouseclick listeners to the shapes I am drawing using the GDI+ commands in a similar sort of way as could be done with the old VB "shapes". Problem is,...
0
1310
by: alwayssmiling | last post by:
Hi, Im drawing some shapes on the image surface (i.e when im displaying the image ) with the help of graphics. Since i want to move thsese shapes from one place to other place in the...
1
2605
by: weberwhennner | last post by:
Hi All, Since two days Ive been trying to draw lines and polygons interactively (using mouse clicks), but all ive found is some libraries that draw shapes using predefined cooredinates. Ive...
6
1369
by: Number 11950 - GPEMC! Replace number with 11950 | last post by:
Are polygonal buttons or perhaps polygons with tooltips and and click events available in VS8 or is it too early yet? Thanks in advance... -- Timothy Casey GPEMC! >11950 is the...
8
2704
by: Hypnotik | last post by:
Hey everyone. I'm writing a program which allows the user to enter information about 2 shapes, either a square, triangle, or rectangle, then 'adds' the shaps together. The resulting shape is a...
0
2186
by: weird0 | last post by:
i have successfully emebedded visio drawing tool in my application. Infinite number of shapes can be added to the drawing. How can i write double click event handler for the the shapes added to...
4
1868
by: Sunny | last post by:
Hi I have a div called shape on my page. When I try to get its length using javascript in IE, everything works fine. But When I try it in Firefox it has element has no properties. Here is the...
1
4987
by: nttamdn | last post by:
Anyone help me please. I want anytime mousemove to one polygon, it's opacity becomes 0.3, and mouseout polygon, i'ts opacity return to 0 again. I means mousemove to show the polygon and hiding it...
0
7199
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7074
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7273
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7322
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7451
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5572
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5000
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3161
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.