ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Magnificent Problem (https://www.excelbanter.com/excel-programming/337832-re-magnificent-problem.html)

PY & Associates

Magnificent Problem
 
Please clarify the following

orients the polygon according to a selected side
You want to plot the polygon along x axis, or y axis, or ???

unit width
1 unit measurement or equal arbitrary units ?

plotting the resulting polygons
user selectively pick any of them to plot individually;
or plot them side by side as if sliced cake please?

Regards
PY & Associates

"Cody" wrote in message
...
I am trying to create code that takes a set of coordinates as corners of a
polygon, orients the polygon according to a selected side, and divides the
polygon into polygons of a unit width. The output would be the set of

values
of the corners of the resulting polygons for the purpose of plotting the
resulting polygons.

Please help me get control of this beast!!!

Thanks




PY & Associates

Magnificent Problem
 
Let the polygon have n sides
it has n corners

let the user pick any of the sides s
its starting point is s
its ending point is s+1

set y=0 to all corners of the polygon
get vertical distances between every pair of corners

let user set the slicing measurement, m
starting from s through n to s+1
drawing lines y=s(y)+m to cut across every sides in its path [any side can
zigzag up and down, or left and right]
tabulate all intersected point coordinates SIDE by SIDE
run across the table row by row, join the points pair by pair [ 1 and 2, but
not 2 and 3, then 3 and 4]

we need to set limits of starting point and ending point of each of these
procedure appropriately.
Good exercise for the mind.

--
Regards
PY & Associates

"PY & Associates" wrote in message
...
Please clarify the following

orients the polygon according to a selected side
You want to plot the polygon along x axis, or y axis, or ???

unit width
1 unit measurement or equal arbitrary units ?

plotting the resulting polygons
user selectively pick any of them to plot individually;
or plot them side by side as if sliced cake please?

Regards
PY & Associates

"Cody" wrote in message
...
I am trying to create code that takes a set of coordinates as corners of

a
polygon, orients the polygon according to a selected side, and divides

the
polygon into polygons of a unit width. The output would be the set of

values
of the corners of the resulting polygons for the purpose of plotting the
resulting polygons.

Please help me get control of this beast!!!

Thanks






cody

Magnificent Problem
 
I want slices at x= 1*unit, x=2*unit, etc until shape is completely sliced.
Something like slicing a loaf of bread. I will only be plotting unique
shapes and summing the quantities of repeats.

"PY & Associates" wrote:

Please clarify the following

orients the polygon according to a selected side
You want to plot the polygon along x axis, or y axis, or ???

unit width
1 unit measurement or equal arbitrary units ?

plotting the resulting polygons
user selectively pick any of them to plot individually;
or plot them side by side as if sliced cake please?

Regards
PY & Associates

"Cody" wrote in message
...
I am trying to create code that takes a set of coordinates as corners of a
polygon, orients the polygon according to a selected side, and divides the
polygon into polygons of a unit width. The output would be the set of

values
of the corners of the resulting polygons for the purpose of plotting the
resulting polygons.

Please help me get control of this beast!!!

Thanks





cody

Magnificent Problem
 
I would typically want to align the first and second corners along the y-axis

"PY & Associates" wrote:

Let the polygon have n sides
it has n corners

let the user pick any of the sides s
its starting point is s
its ending point is s+1

set y=0 to all corners of the polygon
get vertical distances between every pair of corners

let user set the slicing measurement, m
starting from s through n to s+1
drawing lines y=s(y)+m to cut across every sides in its path [any side can
zigzag up and down, or left and right]
tabulate all intersected point coordinates SIDE by SIDE
run across the table row by row, join the points pair by pair [ 1 and 2, but
not 2 and 3, then 3 and 4]

we need to set limits of starting point and ending point of each of these
procedure appropriately.
Good exercise for the mind.

--
Regards
PY & Associates

"PY & Associates" wrote in message
...
Please clarify the following

orients the polygon according to a selected side
You want to plot the polygon along x axis, or y axis, or ???

unit width
1 unit measurement or equal arbitrary units ?

plotting the resulting polygons
user selectively pick any of them to plot individually;
or plot them side by side as if sliced cake please?

Regards
PY & Associates

"Cody" wrote in message
...
I am trying to create code that takes a set of coordinates as corners of

a
polygon, orients the polygon according to a selected side, and divides

the
polygon into polygons of a unit width. The output would be the set of

values
of the corners of the resulting polygons for the purpose of plotting the
resulting polygons.

Please help me get control of this beast!!!

Thanks







PY & Associates[_4_]

Magnificent Problem
 
In my earlier steps to solve the problem, I made a mistake in setting y=0.
I should have set x=0 to get the vertical distances (y).

If you want to slice vertically, you interchange to get horizontal distances
(x) of the corners and get the intersections with lines of constant x. The
principle is the same.

Good exercise.

Regards
PY & Associates

"Cody" wrote:

I would typically want to align the first and second corners along the y-axis

"PY & Associates" wrote:

Let the polygon have n sides
it has n corners

let the user pick any of the sides s
its starting point is s
its ending point is s+1

set y=0 to all corners of the polygon
get vertical distances between every pair of corners

let user set the slicing measurement, m
starting from s through n to s+1
drawing lines y=s(y)+m to cut across every sides in its path [any side can
zigzag up and down, or left and right]
tabulate all intersected point coordinates SIDE by SIDE
run across the table row by row, join the points pair by pair [ 1 and 2, but
not 2 and 3, then 3 and 4]

we need to set limits of starting point and ending point of each of these
procedure appropriately.
Good exercise for the mind.

--
Regards
PY & Associates

"PY & Associates" wrote in message
...
Please clarify the following

orients the polygon according to a selected side
You want to plot the polygon along x axis, or y axis, or ???

unit width
1 unit measurement or equal arbitrary units ?

plotting the resulting polygons
user selectively pick any of them to plot individually;
or plot them side by side as if sliced cake please?

Regards
PY & Associates

"Cody" wrote in message
...
I am trying to create code that takes a set of coordinates as corners of

a
polygon, orients the polygon according to a selected side, and divides

the
polygon into polygons of a unit width. The output would be the set of
values
of the corners of the resulting polygons for the purpose of plotting the
resulting polygons.

Please help me get control of this beast!!!

Thanks






PY & Associates

Magnificent Problem
 
I do not know why that I cannot retrieve the last three messages with
my home computer. Wish to add that you can make the problem simpler if
you transform the axes so that the side you choose, lines up with the Y
axis.

Regards
PY & Associates


cody

Magnificent Problem
 
Thank you for your help.

"PY & Associates" wrote:

I do not know why that I cannot retrieve the last three messages with
my home computer. Wish to add that you can make the problem simpler if
you transform the axes so that the side you choose, lines up with the Y
axis.

Regards
PY & Associates



PY & Associates[_4_]

Magnificent Problem
 
We did the rotation of axes and foresee no problem in the getting the
resulting coordinates. One big problem is Excel plotting axes are not uniform
in scale making the plotting distorted.

"Cody" wrote:

Thank you for your help.

"PY & Associates" wrote:

I do not know why that I cannot retrieve the last three messages with
my home computer. Wish to add that you can make the problem simpler if
you transform the axes so that the side you choose, lines up with the Y
axis.

Regards
PY & Associates




All times are GMT +1. The time now is 12:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com