GitHub PullRequestReviewCommentEvent at 2014-08-13 22:24:51
Repository: sympy
Actor: jcrist
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/sympy/sympy/pulls/comments/16210655","id":16210655,"diff_hunk":"@@ -0,0 +1,395 @@\n+=====================================\n+Scalar and Vector Field Functionality\n+=====================================\n+\n+Introduction\n+============\n+\n+Vectors and Scalars\n+-------------------\n+\n+In vector math, we deal with two kinds of quantities – scalars and vectors.\n+\n+A scalar is an entity which only has a magnitude – no direction. Examples of\n+scalar quantities include mass, electric charge, temperature, distance, etc.\n+\n+A vector, on the other hand, is an entity that is characterized by a\n+magnitude and a direction. Examples of vector quantities are displacement,\n+velocity, magnetic field, etc.\n+\n+A scalar can be depicted just by a number, for e.g. a temperature of 300 K.\n+On the other hand, vectorial quantities like acceleration are usually denoted\n+by a vector. Given a vector :math:`\\mathbf{V}`, the magnitude of the\n+corresponding quantity can be calculated as the magnitude of the vector\n+itself :math:`\\Vert \\mathbf{V} \\Vert`, while the direction would be specified\n+by a unit vector in the direction of the original vector,\n+:math:`\\mathbf{\\hat{V}} = \\frac{\\mathbf{V}}{\\Vert \\mathbf{V} \\Vert}`.\n+\n+For example, consider a displacement of\n+:math:`(3\\mathbf{\\hat{i}} + 4\\mathbf{\\hat{j}} + 5\\mathbf{\\hat{k}})` m,\n+where , as per standard convention, :math:`\\mathbf{\\hat{i}}`,\n+:math:`\\mathbf{\\hat{j}}` and :math:`\\mathbf{\\hat{k}}` represent unit vectors\n+in the :math:`\\mathbf{X}`, :math:`\\mathbf{Y}` and :math:`\\mathbf{Z}`\n+directions respectively. Therefore, it can be concluded that the distance\n+traveled is\n+:math:`\\Vert 3\\mathbf{\\hat{i}} + 4\\mathbf{\\hat{j}} + 5\\mathbf{\\hat{k}} \\Vert`\n+m = :math:`5\\sqrt{2}` m. The direction of travel is given by the unit vector\n+:math:`\\frac{3}{5\\sqrt{2}}\\mathbf{\\hat{i}} +\n+\\frac{4}{5\\sqrt{2}}\\mathbf{\\hat{j}} + \\frac{5}{5\\sqrt{2}}\\mathbf{\\hat{k}}`.\n+\n+Fields\n+------\n+\n+A :math:`field` is a vector or scalar quantity that can be\n+specified everywhere in space as a function of position (Note that in general\n+a field may also be dependent on time and other custom variables). Since we \n+only deal with 3D spaces in this module, a field is defined as a function of \n+the :math:`x`, :math:`y` and :math:`z` coordinates corresponding\n+to a location in 3D space.\n+\n+For example, temperature in 3 dimensional space (a temperature field) can be\n+written as :math:`T(x, y, z)` – a scalar function of the position.\n+An example of a scalar field in electromagnetism is the electric potential.\n+\n+In a similar manner, a vector field can be defined as a vectorial function\n+of the location :math:`(x, y, z)` of any point in space.\n+\n+For instance, every point on the earth may be considered to be in the\n+gravitational force field of the earth. We may specify the field by the\n+magnitude and the direction of acceleration due to gravity\n+(i.e. force per unit mass ) :math:`\\vec g(x, y, z)` at every point in \n+space.\n+\n+To give an example from electromagnetism, consider an electric potential\n+of form :math:`2{x}^{2}y`, a scalar field in 3D space. The corresponding\n+conservative electric field can be computed as the gradient of the electric\n+potential function, and expressed as :math:`4xy\\mathbf{\\hat{i}} +\n+2{x}^{2}\\mathbf{\\hat{j}}`.\n+The magnitude of this electric field can in turn be expressed\n+as a scalar field of the form\n+:math:`\\sqrt{4{x}^{4} + 16{x}^{2}{y}^{2}}`.\n+\n+Implementation in sympy.vector\n+==============================\n+\n+Scalar and vector fields\n+------------------------\n+\n+In :mod:`sympy.vector`, every :mod:`CoordSysCartesian` instance is assigned basis\n+vectors corresponding to the :math:`X`, :math:`Y` and\n+:math:`Z` directions. These can be accessed using the properties\n+named :mod:`i`, :mod:`j` and :mod:`k` respectively. Hence, to define a vector\n+:math:`\\mathbf{v}` of the form\n+:math:`3\\mathbf{\\hat{i}} + 4\\mathbf{\\hat{j}} + 5\\mathbf{\\hat{k}}` with\n+respect to a given frame :math:`\\mathbf{R}`, you would do\n+\n+  >>> from sympy.vector import CoordSysCartesian\n+  >>> R = CoordSysCartesian('R')\n+  >>> v = 3*R.i + 4*R.j + 5*R.k\n+\n+Vector math and basic calculus operations with respect to vectors have\n+already been elaborated upon in the earlier section of this module's\n+documentation.\n+\n+On the other hand, base scalars (or coordinate variables) are implemented\n+in a special class called :mod:`BaseScalar`, and are assigned to every \n+coordinate system, one for each direction from :math:`X`, :math:`Y` and \n+:math:`Z`. These coordinate variables are used to form the expressions of\n+vector or scalar fields in 3D space.\n+For a system :mod:`R`, the :math:`X`, :math:`Y` and :math:`Z` ","path":"doc/src/modules/vector/fields.rst","position":99,"original_position":99,"commit_id":"137b26764a4cb603a32225544ff0236336d1078a","original_commit_id":"137b26764a4cb603a32225544ff0236336d1078a","user":{"login":"jcrist","id":2783717,"avatar_url":"https://avatars.githubusercontent.com/u/2783717?v=2","gravatar_id":"85bba1ca66eb909a289448a90e88f53a","url":"https://api.github.com/users/jcrist","html_url":"https://github.com/jcrist","followers_url":"https://api.github.com/users/jcrist/followers","following_url":"https://api.github.com/users/jcrist/following{/other_user}","gists_url":"https://api.github.com/users/jcrist/gists{/gist_id}","starred_url":"https://api.github.com/users/jcrist/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jcrist/subscriptions","organizations_url":"https://api.github.com/users/jcrist/orgs","repos_url":"https://api.github.com/users/jcrist/repos","events_url":"https://api.github.com/users/jcrist/events{/privacy}","received_events_url":"https://api.github.com/users/jcrist/received_events","type":"User","site_admin":false},"body":"Throughout your docs you use `:mod:` to make things into code. This isn't what `:mod:` is for. `:mod:` creates a reference to a module (hence the name) also in the docs. If you want to code format something inline, use double backticks around it. For more information: http://sphinx-doc.org/markup/inline.html","created_at":"2014-08-13T22:24:51Z","updated_at":"2014-08-13T22:24:51Z","html_url":"https://github.com/sympy/sympy/pull/7860#discussion_r16210655","pull_request_url":"https://api.github.com/repos/sympy/sympy/pulls/7860","_links":{"self":{"href":"https://api.github.com/repos/sympy/sympy/pulls/comments/16210655"},"html":{"href":"https://github.com/sympy/sympy/pull/7860#discussion_r16210655"},"pull_request":{"href":"https://api.github.com/repos/sympy/sympy/pulls/7860"}}},"pull_request":{"url":"https://api.github.com/repos/sympy/sympy/pulls/7860","id":19735883,"html_url":"https://github.com/sympy/sympy/pull/7860","diff_url":"https://github.com/sympy/sympy/pull/7860.diff","patch_url":"https://github.com/sympy/sympy/pull/7860.patch","issue_url":"https://api.github.com/repos/sympy/sympy/issues/7860","number":7860,"state":"open","locked":false,"title":"WIP: Sphinx Docs for Vector module","user":{"login":"srjoglekar246","id":2099293,"avatar_url":"https://avatars.githubusercontent.com/u/2099293?v=2","gravatar_id":"33de082824c98c9f37b7cb812e412bba","url":"https://api.github.com/users/srjoglekar246","html_url":"https://github.com/srjoglekar246","followers_url":"https://api.github.com/users/srjoglekar246/followers","following_url":"https://api.github.com/users/srjoglekar246/following{/other_user}","gists_url":"https://api.github.com/users/srjoglekar246/gists{/gist_id}","starred_url":"https://api.github.com/users/srjoglekar246/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srjoglekar246/subscriptions","organizations_url":"https://api.github.com/users/srjoglekar246/orgs","repos_url":"https://api.github.com/users/srjoglekar246/repos","events_url":"https://api.github.com/users/srjoglekar246/events{/privacy}","received_events_url":"https://api.github.com/users/srjoglekar246/received_events","type":"User","site_admin":false},"body":"Adds Sphinx docs for the new sympy.vector module","created_at":"2014-08-13T16:33:34Z","updated_at":"2014-08-13T22:24:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d361ff15ab8fca2eadcf1ea4e18fca8f6fffb01f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sympy/sympy/pulls/7860/commits","review_comments_url":"https://api.github.com/repos/sympy/sympy/pulls/7860/comments","review_comment_url":"https://api.github.com/repos/sympy/sympy/pulls/comments/{number}","comments_url":"https://api.github.com/repos/sympy/sympy/issues/7860/comments","statuses_url":"https://api.github.com/repos/sympy/sympy/statuses/137b26764a4cb603a32225544ff0236336d1078a","head":{"label":"srjoglekar246:vectordoc","ref":"vectordoc","sha":"137b26764a4cb603a32225544ff0236336d1078a","user":{"login":"srjoglekar246","id":2099293,"avatar_url":"https://avatars.githubusercontent.com/u/2099293?v=2","gravatar_id":"33de082824c98c9f37b7cb812e412bba","url":"https://api.github.com/users/srjoglekar246","html_url":"https://github.com/srjoglekar246","followers_url":"https://api.github.com/users/srjoglekar246/followers","following_url":"https://api.github.com/users/srjoglekar246/following{/other_user}","gists_url":"https://api.github.com/users/srjoglekar246/gists{/gist_id}","starred_url":"https://api.github.com/users/srjoglekar246/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srjoglekar246/subscriptions","organizations_url":"https://api.github.com/users/srjoglekar246/orgs","repos_url":"https://api.github.com/users/srjoglekar246/repos","events_url":"https://api.github.com/users/srjoglekar246/events{/privacy}","received_events_url":"https://api.github.com/users/srjoglekar246/received_events","type":"User","site_admin":false},"repo":{"id":5945782,"name":"sympy","full_name":"srjoglekar246/sympy","owner":{"login":"srjoglekar246","id":2099293,"avatar_url":"https://avatars.githubusercontent.com/u/2099293?v=2","gravatar_id":"33de082824c98c9f37b7cb812e412bba","url":"https://api.github.com/users/srjoglekar246","html_url":"https://github.com/srjoglekar246","followers_url":"https://api.github.com/users/srjoglekar246/followers","following_url":"https://api.github.com/users/srjoglekar246/following{/other_user}","gists_url":"https://api.github.com/users/srjoglekar246/gists{/gist_id}","starred_url":"https://api.github.com/users/srjoglekar246/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/srjoglekar246/subscriptions","organizations_url":"https://api.github.com/users/srjoglekar246/orgs","repos_url":"https://api.github.com/users/srjoglekar246/repos","events_url":"https://api.github.com/users/srjoglekar246/events{/privacy}","received_events_url":"https://api.github.com/users/srjoglekar246/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/srjoglekar246/sympy","description":"A computer algebra system written in pure Python","fork":true,"url":"https://api.github.com/repos/srjoglekar246/sympy","forks_url":"https://api.github.com/repos/srjoglekar246/sympy/forks","keys_url":"https://api.github.com/repos/srjoglekar246/sympy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/srjoglekar246/sympy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/srjoglekar246/sympy/teams","hooks_url":"https://api.github.com/repos/srjoglekar246/sympy/hooks","issue_events_url":"https://api.github.com/repos/srjoglekar246/sympy/issues/events{/number}","events_url":"https://api.github.com/repos/srjoglekar246/sympy/events","assignees_url":"https://api.github.com/repos/srjoglekar246/sympy/assignees{/user}","branches_url":"https://api.github.com/repos/srjoglekar246/sympy/branches{/branch}","tags_url":"https://api.github.com/repos/srjoglekar246/sympy/tags","blobs_url":"https://api.github.com/repos/srjoglekar246/sympy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/srjoglekar246/sympy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/srjoglekar246/sympy/git/refs{/sha}","trees_url":"https://api.github.com/repos/srjoglekar246/sympy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/srjoglekar246/sympy/statuses/{sha}","languages_url":"https://api.github.com/repos/srjoglekar246/sympy/languages","stargazers_url":"https://api.github.com/repos/srjoglekar246/sympy/stargazers","contributors_url":"https://api.github.com/repos/srjoglekar246/sympy/contributors","subscribers_url":"https://api.github.com/repos/srjoglekar246/sympy/subscribers","subscription_url":"https://api.github.com/repos/srjoglekar246/sympy/subscription","commits_url":"https://api.github.com/repos/srjoglekar246/sympy/commits{/sha}","git_commits_url":"https://api.github.com/repos/srjoglekar246/sympy/git/commits{/sha}","comments_url":"https://api.github.com/repos/srjoglekar246/sympy/comments{/number}","issue_comment_url":"https://api.github.com/repos/srjoglekar246/sympy/issues/comments/{number}","contents_url":"https://api.github.com/repos/srjoglekar246/sympy/contents/{+path}","compare_url":"https://api.github.com/repos/srjoglekar246/sympy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/srjoglekar246/sympy/merges","archive_url":"https://api.github.com/repos/srjoglekar246/sympy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/srjoglekar246/sympy/downloads","issues_url":"https://api.github.com/repos/srjoglekar246/sympy/issues{/number}","pulls_url":"https://api.github.com/repos/srjoglekar246/sympy/pulls{/number}","milestones_url":"https://api.github.com/repos/srjoglekar246/sympy/milestones{/number}","notifications_url":"https://api.github.com/repos/srjoglekar246/sympy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/srjoglekar246/sympy/labels{/name}","releases_url":"https://api.github.com/repos/srjoglekar246/sympy/releases{/id}","created_at":"2012-09-25T06:17:23Z","updated_at":"2014-06-23T21:32:34Z","pushed_at":"2014-08-13T16:32:09Z","git_url":"git://github.com/srjoglekar246/sympy.git","ssh_url":"git@github.com:srjoglekar246/sympy.git","clone_url":"https://github.com/srjoglekar246/sympy.git","svn_url":"https://github.com/srjoglekar246/sympy","homepage":"http://sympy.org/","size":69714,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sympy:master","ref":"master","sha":"28a6e9fcb462baf6eafa913f434db270736b2d4b","user":{"login":"sympy","id":260832,"avatar_url":"https://avatars.githubusercontent.com/u/260832?v=2","gravatar_id":"cbddfebe00a15f38108875eaafa827de","url":"https://api.github.com/users/sympy","html_url":"https://github.com/sympy","followers_url":"https://api.github.com/users/sympy/followers","following_url":"https://api.github.com/users/sympy/following{/other_user}","gists_url":"https://api.github.com/users/sympy/gists{/gist_id}","starred_url":"https://api.github.com/users/sympy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sympy/subscriptions","organizations_url":"https://api.github.com/users/sympy/orgs","repos_url":"https://api.github.com/users/sympy/repos","events_url":"https://api.github.com/users/sympy/events{/privacy}","received_events_url":"https://api.github.com/users/sympy/received_events","type":"Organization","site_admin":false},"repo":{"id":640534,"name":"sympy","full_name":"sympy/sympy","owner":{"login":"sympy","id":260832,"avatar_url":"https://avatars.githubusercontent.com/u/260832?v=2","gravatar_id":"cbddfebe00a15f38108875eaafa827de","url":"https://api.github.com/users/sympy","html_url":"https://github.com/sympy","followers_url":"https://api.github.com/users/sympy/followers","following_url":"https://api.github.com/users/sympy/following{/other_user}","gists_url":"https://api.github.com/users/sympy/gists{/gist_id}","starred_url":"https://api.github.com/users/sympy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sympy/subscriptions","organizations_url":"https://api.github.com/users/sympy/orgs","repos_url":"https://api.github.com/users/sympy/repos","events_url":"https://api.github.com/users/sympy/events{/privacy}","received_events_url":"https://api.github.com/users/sympy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sympy/sympy","description":"A computer algebra system written in pure Python","fork":false,"url":"https://api.github.com/repos/sympy/sympy","forks_url":"https://api.github.com/repos/sympy/sympy/forks","keys_url":"https://api.github.com/repos/sympy/sympy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sympy/sympy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sympy/sympy/teams","hooks_url":"https://api.github.com/repos/sympy/sympy/hooks","issue_events_url":"https://api.github.com/repos/sympy/sympy/issues/events{/number}","events_url":"https://api.github.com/repos/sympy/sympy/events","assignees_url":"https://api.github.com/repos/sympy/sympy/assignees{/user}","branches_url":"https://api.github.com/repos/sympy/sympy/branches{/branch}","tags_url":"https://api.github.com/repos/sympy/sympy/tags","blobs_url":"https://api.github.com/repos/sympy/sympy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sympy/sympy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sympy/sympy/git/refs{/sha}","trees_url":"https://api.github.com/repos/sympy/sympy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sympy/sympy/statuses/{sha}","languages_url":"https://api.github.com/repos/sympy/sympy/languages","stargazers_url":"https://api.github.com/repos/sympy/sympy/stargazers","contributors_url":"https://api.github.com/repos/sympy/sympy/contributors","subscribers_url":"https://api.github.com/repos/sympy/sympy/subscribers","subscription_url":"https://api.github.com/repos/sympy/sympy/subscription","commits_url":"https://api.github.com/repos/sympy/sympy/commits{/sha}","git_commits_url":"https://api.github.com/repos/sympy/sympy/git/commits{/sha}","comments_url":"https://api.github.com/repos/sympy/sympy/comments{/number}","issue_comment_url":"https://api.github.com/repos/sympy/sympy/issues/comments/{number}","contents_url":"https://api.github.com/repos/sympy/sympy/contents/{+path}","compare_url":"https://api.github.com/repos/sympy/sympy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sympy/sympy/merges","archive_url":"https://api.github.com/repos/sympy/sympy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sympy/sympy/downloads","issues_url":"https://api.github.com/repos/sympy/sympy/issues{/number}","pulls_url":"https://api.github.com/repos/sympy/sympy/pulls{/number}","milestones_url":"https://api.github.com/repos/sympy/sympy/milestones{/number}","notifications_url":"https://api.github.com/repos/sympy/sympy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sympy/sympy/labels{/name}","releases_url":"https://api.github.com/repos/sympy/sympy/releases{/id}","created_at":"2010-04-30T20:37:14Z","updated_at":"2014-08-13T18:14:41Z","pushed_at":"2014-08-13T14:41:01Z","git_url":"git://github.com/sympy/sympy.git","ssh_url":"git@github.com:sympy/sympy.git","clone_url":"https://github.com/sympy/sympy.git","svn_url":"https://github.com/sympy/sympy","homepage":"http://sympy.org/","size":214707,"stargazers_count":1527,"watchers_count":1527,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":705,"mirror_url":null,"open_issues_count":1514,"forks":705,"open_issues":1514,"watchers":1527,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sympy/sympy/pulls/7860"},"html":{"href":"https://github.com/sympy/sympy/pull/7860"},"issue":{"href":"https://api.github.com/repos/sympy/sympy/issues/7860"},"comments":{"href":"https://api.github.com/repos/sympy/sympy/issues/7860/comments"},"review_comments":{"href":"https://api.github.com/repos/sympy/sympy/pulls/7860/comments"},"review_comment":{"href":"https://api.github.com/repos/sympy/sympy/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/sympy/sympy/pulls/7860/commits"},"statuses":{"href":"https://api.github.com/repos/sympy/sympy/statuses/137b26764a4cb603a32225544ff0236336d1078a"}}}}