Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Introduction to Computer Programming Dr. Jennifer Glenn, Spring 17 Assignment #4 Due during the Week of April 3rd 8th, 2017 (Beginning of Labs) Assignment objectives:

image text in transcribed
image text in transcribed
Introduction to Computer Programming Dr. Jennifer Glenn, Spring 17 Assignment #4 Due during the Week of April 3rd 8th, 2017 (Beginning of Labs) Assignment objectives: I. Understand Nested For loops and Nested If Statements. 2. Understand Arrays. 3. Use VBA String Functions. Task write a VBA sub program to verify whether a point (with x and y coordinates) lies within a specified irregular polygon. Here is the basic principle and process that you need to understand to classify whether a point lies within the irregular polygon or not. 1. 1. The irregular polygon that you consider must be described by a series of coordinates connected by straight lines. In the example illustrated in the figure below, an irregular polygon is drawn considering the following set of points X Co-ordinate Y Co-ordinate 28 27 28 30.5 30.5 (Note: As seen from the figure below, each consecutive pair of coordinates form a line on the chart.) 2 It is essential the polygon is a closed area for the procedure to work properly. Ohis condition has to be in the Make sure the points declared in such a way that the lines connecting two adjacent points do not ntersec Hints: 1. Area is enclosed if the last point and first point are equal. 2. If the polygon considered has eight edges, there will be 9 points that user hasto provide as input. Define the number of edges for irregular polygon first and then use this input further in the program 2. Principle: The standard method to determine whether a point lies inside or outside the figure is to draw ray" from the point extending out to infinity. If the ray crosses the boundary line(s) of the figure an odd number of times, the point lies inside the figure. In the example illustrated in the figure below, when a "ray" is drawn vertically upwards from the orange point, the ray crosses the boundary lines an odd number of times while the ray drawn from the grey point crosses the boundary lines an even number of A general algorithm (procedure/pseudo code) to test whether a point xA,yA lies within the figure is as For each N edges that make up the figure: hen go to the next edge

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

OpenStack Trove

Authors: Amrith Kumar, Douglas Shelley

1st Edition

1484212215, 9781484212219

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago