Tuesday, August 31, 2010

Creating Columns in Articles

I was going to write a blog about this subject, but I found someone else blog that already does it. Rather than be a jerk and steal his (or her) content, I'll just link to it.


The only thing I would add is that, for anybody that uses the \textwidth variable, it still refers to the width of the page, and not the width of the column, so use \columnwidth instead.



Equation of a Line

Urban Indy

I enjoying working on collaborative websites. Hoosier Beer Geek has been an absolute delight over the past four years. And I'm happy to say that I'm working with another great group of people at Urban Indy, which started as an individual's blog but has now relaunched as a collaborative effort. I'm thrilled to be writing and working with this group of concerned urbanists. My first effort went online yesterday: The freedoms, benefits that come from riding the bus.

You'll see a lot more of my writings over there. I'm not sure yet what will come of this blog. I won't take it off line, but I'm not sure what the future holds for this blog. But in the meantime, I invite you to visit Urban Indy where I join Curtis Ailes (Huston Street Racing), Chr! is Corr (DIG-B), Graeme Sharpe (A Place of Sense), Kevin Kastner (creator of Urban Indy) and Kirsten Eamon-Shine (Middle West Meals).

Circles and Circle Properties

Bing Maps Silverlight Control Part 5: Calculating Distance

My dad was the first person to show me how to measure distances on a map using a pair of dividers and the scale printed on the map key. There is a much better way to do this using the Bing Maps Silverlight control -- it just takes a little programming and finding the right equation.

video

Here is the Bobcat Video I told you about:



Back to Programming...

Here is how you calculate the distance between points on the e! arth. You also need to know EarthRadiusInMiles = 3956.0;


/// <summary>
/// Calculate the distance between two geocodes. Defaults to using Miles.
/// </summary>
public static double CalcDistance(double lat1, double lng1, double lat2, double lng2)
{
return CalcDistance(lat1, lng1, lat2, lng2, GeoCodeCalcMeasurement.Miles);
}
/// <summary>
/// Calculate the distance between two geocodes.
/// </summary>
public static double CalcDistance(double lat1, double lng1, double lat2, double lng2, GeoCodeCalcMeasurement m)
{
double radius = GeoCodeCalc.EarthRadiusInMiles;
if (m == GeoCodeCalcMeasurement.Kilometers) { radius = GeoCodeCalc.EarthRadiusInKilometers; }
return radius * 2 * Math.Asin(Math.Min(1, Math.Sqrt((Math.Pow(Math.Sin((DiffRadian(lat1, lat2)) / 2.0), 2.0) + Math.Cos(ToRadian(lat1)) * Math.Cos(ToRadian(lat2)) * Math.Pow(Math.Sin((DiffRadian(lng1, lng2)) / 2.0), 2.0)))));
}

I created a Marker class to mark the end points of the distance calculation. To show the user that they are in distance calculation mode, I have also changed the cursor on the map control. In this case, I alternate between the arrow and the pointing finger.

PointsOfInterest m_oMarkers = new PointsOfInterest();

void cbMeasur! e_Checked(object sender, RoutedEvent! Args e)< br /> {
Map1.Cursor = Cursors.Hand;
m_oMarkers.Clear();
}
void cbMeasure_Unchecked(object sender, RoutedEventArgs e)
{
Map1.Cursor = Cursors.Arrow;
if ( m_oMarkers.Count > 1 )
AddLine(m_oMarkers,.5);
}

The code for collecting the user's selection of points is here:


void Map1_MouseClick(object sender, MapMouseEventArgs e)
{
var oLocation = Map1.ViewportPointToLocation(e.ViewportPoint);

PointOfInterest oPOI = null;
if (cbMeasure.IsChecked == true)
{
oPOI = new Marker() { Loc = oLocation };
m_oMarkers.Add(oPOI);
}
else
{
! oPOI = new PointOfInterest()! { Loc = oLocation };
m_oList.Add(oPOI);
}

RenderPoint(oPOI);

if (cbDraw.IsChecked == true)
try
{
double dRadius = double.Parse(txtRadius.Text);
AddCircle(oLocation, dRadius, .5);
}
catch( Exception ex)
{
MessageBox.Show(ex.Message);
}
}

Using a polyline and a tool tip is great way to report the distance:


double DistanceInMiles(LocationCollection oLocs)
{
double dDistance = 0.0;
for (int i = 0; i < oLocs.Count() - 1; i++)
dDistance += DistanceInMiles(oLocs[i], oLocs[i + 1]);

! return dDistance;
! }

double DistanceInMiles(Location Loc1, Location Loc2)
{
double dMiles = GeoCodeCalc.CalcDistance(Loc1.Latitude, Loc1.Longitude, Loc2.Latitude, Loc2.Longitude);
return dMiles;
}

LocationCollection RenderLine(List<PointOfInterest> oList)
{

var oPOIs = (from oPOI in oList
where oPOI is Marker
select oPOI).ToList<PointOfInterest>();

var oLocs = new LocationCollection();
foreach (var oPOI in oPOIs)
oLocs.Add(oPOI.Loc);

return oLocs;
! }


void AddLine(List<PointOfInterest> oList, double dOpacity)
{
MapPolyline polyline = new MapPolyline();
polyline.Stroke = new SolidColorBrush(Colors.Red);
polyline.StrokeThickness = 1;
polyline.Opacity = dOpacity;

//this works in miles
LocationCollection oLocs = RenderLine(oList);
polyline.Locations = oLocs;
Map1.AddChild(polyline);

double dDist = DistanceInMiles(oLocs);

ToolTipService.SetToolTip(polyline, string.Format("{0:0.0} mi \n {1:0.00} yd", dDist, dDist * 5280.0 / 3.0));
}

Calculate Distance Formula

Follow up to problem E9 - Composite values of integer polynomials

I’ve been doing some more thinking about Problem E9, which asks the reader to prove that the range of a quadratic polynomial evaluated on the integers must include a composite number. In addition to the algebraic proof I linked to the original problem, my brother provided a proof based on congruences. I think both are interesting.

Each proof applies to all non-trivial polynomials, not just quadratics, and each actually shows (or can be extended to show) that the range of the polynomial must include an infinite number of composite numbers.

One question to which I do not know the answer is whether the range of a polynomial must contain an infinite number of prime numbers. Of course, the answer is “no” if the polynomial factors over the integers. If the polynomial is prime, however, I suspect the answer is “yes”.

For linear polynomials, the prime or co! mposite nature of the ranges have been well studied. In 1837, Dirichlet proved that every sequence (an + b) contains an infinite number of prime numbers, iff (a, b) = 1, and moreover the fraction of all primes ≤ x that are in such a sequence approaches 1/φ(a) as x approaches infinity, where φ(a) is the number of natural numbers less than a that are relatively prime to a. As a corollary, this also shows that there are an infinite number of composite numbers in the range.

Dirichlet’s Theorem is famous for being the first that used complex analysis to solve a major problem in number theory. Recently (2004), Green and Tao (in an important and difficult paper) proved that there exist arithmetic sequences of arbitrary length that are all prime. The proof is non-constructive.

arithmetic sequence and polynomial problems

Calculate the perimeter of the quadrilateral

Question
The perimeter of the quadrilateral is 120cm. Find the lengths and sides. (x+5)(x^2-3)(3x-8)(x+3).



Solution
Let us first define how to measure the perimeter of a quadrilateral. The perimeter of any quadrilateral, or any shape with four sides for that matter, is measured by adding the lengths of its sides. Hence, the quadrilateral on the ri! ght has a perimeter of 30 which is computed by adding the measure of its sides - 6 + 9 + 7 + 8.

Now, let us go back to our problem. The four sides of the quadrilateral are (x+5), (x^2-3), (3x-8) and (x+3). Hence, its perimeter is computed by (x+5) + (x^2-3) + (3x-8) + (x+3).

To solve for the length of the sides of the quadrilateral:

(x+5) + (x^2-3) + (3x-8) + (x+3) = 120
x^2 - 3+ x+5 + 3x - 8 + x + 3 = 120
x^2 + 5x - 3 = 120 ===> add like terms
x^2 + 5x - 123 = 0 ===> right side of the equation is set to zero
(x + ?) (x - ?) = 0 ====> to arrive at the root of the quadratic equation, think of two numbers that when you multiply them yields -123 and when you add them gives 5. Hmmm...difficult, however nothing prevents us to looking at a solution which is NOT a whole number.

Now, I got 13.87 and -8.87. Their multiple is -123.02 [close enough] and their sum is 5.

(x + 13.87) (x - 8.87) = 0
x = -13.! 87 ===> this is NOT an option because it is NEGATIVE.
x = 8.87

Now to calculate the lengths of the sides of the quadrilateral:
(x+5) ===> 13.87
(x^2-3) ==> 75.68
(3x-8) ===> 18.61
(x+3) ===> 11.87

Now to check whether the sum of the above is 120. 13.87 + 75.68 + 18.61 + 11.87 = 120.02 [close enough]

Please do not forget to leave a feedback in Allexperts.com AND a comment in this blog.




[Image via TPUB]

calculate the area of a quadrilateral

Dynamical Systems - 8/4/10

Today, we were treated to a quick introduction to dynamical systems, an area of math which focuses on repeated iteration of maps to study long-term or asymptotic behavior associated with this iteration.

We started by taking a simple example. Consider a real valued function f from R to R. Then consider the sequence of points (x, f(x), f(f(x)) ....) We call this sequence the orbit of the point x.

Let us take f(x) = kx(1-x), which is the equation for a quadratic function. Also consider the identity map, g(x) = x.
For now, we take k >0.
Depending on our specific value of k, we have a parabola which intersects the g(x) either once or twice.

We are interested in the fixed points of f. As the name implies, these are points where the map f leaves a point in its domain fixed, or in symbols: f(x1) = x1.
We wish to study asymptotic behavior of functions. To do this, we! pick a point x on the real line and first apply the function. This gives us a new point f(x). Then we find f(f(x)). Since we have the identity map also drawn in (in this case, g(x)), this process is applying f, moving horizontally to g, moving vertically to f, and so on.

We see that repeating this process, we notice two general patterns: In some situations, we may continue onward towards positive or negative infinity in an unbounded fashion. However, for other sections of the real line, we see that there is a convergence towards certain fixed points.

We call a fixed point x attracting if the magnitude of its derivative at x is less than 1 and we say a fixed point is repelling if the magnitude of its derivative at x is greater than 1.

We see then that the derivative of the function at these fixed points greatly affects this convergence behavior.

Afterwa! rds, we moved on to dynamics of complex functions which map th! e comple x plane to itself.

We first took f: C -> C (complex plane to itself) given by f(z) = z^2 + c for some complex number c.

If we let c = 0, then points inside the unit disk spiral towards the origin. Points outside the unit disk spiral to infinity. We see that points on the unit circle itself get mapped to other points on the unit circle (their length is preserved, but they rotate.) Thus the mapping leaves the unit circle invariant. Furthermore, we see that iterates of the map can map a small section of the unit disk onto the whole unit disk.

We now consider the effect of varying our complex number c. For c very small, we obtain a similar picture: the interior of the curve spirals inward to the center, the curve itself is invariant, and the outer regions escape to infinity.
For very large x, most points escape outward to infinity.

We then construct the Mande! lbrot set as the set of points c such that the n-th iterate of the map f does not go to infinity when evaluated at the point c itself for technical reasons.
We take all parameters c and iterate at the point c itself.

Similar to our notion of fixed points, we say a point z in the complex plane is periodic with a period n if the n-th iterate of f applied at z = z.

We concluded by seeing various pictures of the Mandelbrot set and fractals constructed through similar dynamical systems in the complex plane.




Angle of Intersection between two Curves Examples

MPC 20S - Adding and Subtracting Radicals - Exercise 33&34

http://www.divshare.com/download/11038155-3ab Show More Sharing Options

subtracting radicals