Write an algorithm that takes two line segments as input

Assignment Help Algebra
Reference no: EM131060569

1 Dimensions

1.1 Prove that a set of 3 points a, b, and c in the plane are collinear if and only if the vectors [a1], [b1], and [c1] are linearly dependent, i.e. one of these points can be written as a linear combination of the other two. Note, you should use the equation of the line through the points to define the linear dependence.

1.2 We say that affine dimension of a set of points is the dimension of the space of all affine combinations. A point is 0-dimensional. A line is 1-dimensional. A plane is 2-dimensional. This is a little different from the notion of dimension used for vector spaces. It is true that a 1-dimensional vector space is a line, but that means it can be represented as all linear combinations of a single vector. For a general line, we need at least two points. (This is the difference between vectors and points). Prove that the affine dimension of a set of points p1, ... ,pn ∈ R3 is one less than the dimension of the vector space spanned by [p11] , ... , [pn1].

1.3 Most of the time, question 1.2 means that the affine dimension of {p1, ... , pn} is one less than the linear dimension of the same set of points when viewed as vectors. When is the affine dimension equal to the linear dimension?

2 Convexity

2.1 In class, we gave two different definitions of the convex closure of a set U Rd:

1. CC(U) is the set of all convex combinations of the points of U.

2. CC(U) is the intersection of all convex sets containing U.

Prove these definitions are equivalent.

2.2 In class, we gave two different definitions to describe when a set U Rd is convex:

1. U is convex iff U = CC(U).

2. U is convex iff for every pair of points a, b U, and all t ∈ [0, l] it is true that (1- t) a + tb U. Prove these definitions are equivalent.

3 Using Linear Predicates

3.1 Let ccw(a, b, c) be the counterclockwise test introduced in class. That is,

244_Matrix.png

Use this predicate to write an algorithm that takes 4 points as input and decides whether or not they are in convex position (i.e. every point is on the convex hull). Do not assume general position. For this problem, we will say that the points are not in convex position if one of the points is on the line throughg two of the other points. Give some justification for why it is correct.

3.2 In class we saw how to check if two line segments intersect using ccw. In this question, you will give the "robust" version of that algorithm. Write an algorithm that takes two line segments as input (specified by the end points) and outputs true if the segments intersect and false otherwise. Assume that the segments are closed, so they are considered intersecting if the endpoint of one line segment lies on the other segment. This will require that you check for 0 in ccw test.

Reference no: EM131060569

Questions Cloud

Construct a timer program that will operate a lamp : An operation requires timing a long period of 18 hours. Construct a timer program that will operate a lamp once the period has elapsed
Calculate the departmental overhead rate : Handy Display Company manufactures display cases to be sold to retail stores. The cases come in three sizes: large, medium, and small. Calculate the departmental overhead rate for each of the three departments listed.
Write code to complete printfactorial()''s recursive case : Write code to complete PrintFactorial()'s recursive case. Sample output if userVal is 5:
Assuming no personal taxes on debt or equity income : The unlevered firm expects to earn $250,000 in net operating income each year for the foreseeable future. It has a tax rate of 40% and has a capitalization rate of 8% equal to the industry required return for this type of firm. what is the overall va..
Write an algorithm that takes two line segments as input : Write an algorithm that takes two line segments as input (specified by the end points) and outputs true if the segments intersect and false otherwise.
What is its yield to maturity and current yield : You have just purchased a 14% coupon bond for 1277.37. It has a maturity of 6 years and par value of 1000. What is its current yield. What is its yield to maturity. What is the expected price one year from now if interest rates stay the same.
Main cost of the operation of commercial banks : Which of the following is the main cost of the operation of commercial banks?
Target audience for del taco : Match the demographic profile of your target audience for Del Taco with the types of television programs that they are most likely to watch on a regular basis.
What is an immutable class : What is an Immutable Class ?

Reviews

Write a Review

Algebra Questions & Answers

  Solve the linear model

Select five values for x to plug into the linear function, P(x)=10x-7 and prepare a table of values

  Identify the sample and suggest a population

Identify the sample and suggest a population

  Evaluate the ratios

Evaluate the ratios and check are the ratios equivalent.

  Define variables and profit function

Define variables and profit function

  Make a linear equation

Assume you have a lemonade stand, & when you charge $1 per cup of lemonade you sell 50 cups. But when you raise your price to $2 you only sell 25 cups. Make an equation for the number of cups you sell as a function of the price you charge. Denote "C"..

  Classify linear and non linear functions

For each of the relationships given below, describe whether you think it is best explained by a linear function or a non-linear function.

  Which of the following are functions

Which of the following are functions?  The two problems, i.e., 1 & 3, are multi part relations consider all parts when determining whether or not these relations are functions. Explain your reason for 1, 2, & 3.

  Using venn diagram for solving word problems

Using venn diagram for solving word problems.

  Joint probability density function

The joint probability density function.

  Applications of combination

Applications of combination

  Solving problems using venn diagram

Solving problems using venn diagram.

  Solving problems into equation

Solving problems into equation.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd