Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Need help with C++ programming of coordinate system

Status
Not open for further replies.

manifolds

Newbie level 5
Newbie level 5
Joined
Jul 7, 2005
Messages
10
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,358
C++ xperts, help me!!

whom it may concern :)

i hv a set of points in x-y coordinates
(2,3), (4,5), (9,0), (8,7)......lots of them actually.

and i want to assign p[1]=(2,3)
p[2]=(4,5)
and so on..means i will hv
for(i=0,i<=N,i++)
p=(x.y)
well, something like that..

how to do that? how to make it understand that, that is a coordinate system.

is it something to do with command CPoint? or Struct or something? huhuhu..:?::cry::cry::cry::cry::cry:
 

Re: C++ xperts, help me!!

manifolds said:
whom it may concern :)

i hv a set of points in x-y coordinates
(2,3), (4,5), (9,0), (8,7)......lots of them actually.

and i want to assign p[1]=(2,3)
p[2]=(4,5)
and so on..means i will hv
for(i=0,i<=N,i++)
p=(x.y)
well, something like that..

how to do that? how to make it understand that, that is a coordinate system.

is it something to do with command CPoint? or Struct or something? huhuhu..:?::cry::cry::cry::cry::cry:


There are a lot of method to solve your problem

One very simple soulution here

typedef struct {
int/double x, y ;
} Point ;

Point p = new[1000] ;

for( int i=o; i<N; i+ ) {
p.x = x ;
p.y = y ;
}
 

Re: C++ xperts, help me!!

visioneer said:
manifolds said:
whom it may concern :)

i hv a set of points in x-y coordinates
(2,3), (4,5), (9,0), (8,7)......lots of them actually.

and i want to assign p[1]=(2,3)
p[2]=(4,5)
and so on..means i will hv
for(i=0,i<=N,i++)
p=(x.y)
well, something like that..

how to do that? how to make it understand that, that is a coordinate system.

is it something to do with command CPoint? or Struct or something? huhuhu..:?::cry::cry::cry::cry::cry:


There are a lot of method to solve your problem

One very simple soulution here

typedef struct {
int/double x, y ;
} Point ;

Point p = new[1000] ;

for( int i=o; i<N; i+ ) {
p.x = x ;
p.y = y ;
}


so before that i should hv:

int x={2,4,5...};
int y={3,5,6,7..};

is it?
 

Re: C++ xperts, help me!!

cfant said:
No, your sintax is incorrect.

:cry: care to correct me?

another thing is: how to convert from screen coordinate to cartesian coordinate in MFC window?

haiyyyyaaa:?::?:
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top