File:Examples for calculating the square root of 2 with Heron's method.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file (SVG file, nominally 720 × 540 pixels, file size: 28 KB)

Captions

Captions

Add a one-line explanation of what this file represents

Summary

[edit]
Description
English: First elements of the sequence we get, when we calculate with Heron's Method via the recursion with the starting points , and .
Date
Source Own work
Author Stephan Kulla (User:Stephan Kulla)
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with Matplotlib.
Source code
InfoField

Python code

import numpy as np
import matplotlib.pyplot as plt

n_max = 5.0

def square_root_seg(a, x_0):
    x_n = x_0

    while True:
        yield x_n
        x_n = (x_n + a / x_n) / 2.0

ns = np.arange(0, n_max + 0.01, 1.)

plt.plot([0,n_max],[np.sqrt(2),np.sqrt(2)], color="black")

for x_0 in [ 2.0, 4.0, 8.0 ]:
    xs = np.fromiter(square_root_seg(2.0, x_0), np.float, ns.size)
    plt.plot(ns, xs, "o", label="$x_0=%d$" % int(x_0))

plt.text(7.2, np.sqrt(2)-0.1, "$\sqrt{2}$")
plt.legend(loc='upper right')
plt.savefig("Examples for calculating the square root of 2 with Heron's method.svg")

Licensing

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current20:15, 13 May 2016Thumbnail for version as of 20:15, 13 May 2016720 × 540 (28 KB)Stephan Kulla (talk | contribs)lesser elements...
20:06, 13 May 2016Thumbnail for version as of 20:06, 13 May 2016720 × 540 (30 KB)Stephan Kulla (talk | contribs)User created page with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata