<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://jsxgraph.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Add_custom_methods_to_objects</id>
	<title>Add custom methods to objects - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://jsxgraph.org/wiki/index.php?action=history&amp;feed=atom&amp;title=Add_custom_methods_to_objects"/>
	<link rel="alternate" type="text/html" href="https://jsxgraph.org/wiki/index.php?title=Add_custom_methods_to_objects&amp;action=history"/>
	<updated>2026-04-06T01:53:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://jsxgraph.org/wiki/index.php?title=Add_custom_methods_to_objects&amp;diff=6403&amp;oldid=prev</id>
		<title>Nicolas.adenis.lamarre: Created page with &quot;JSXGraph objects can be extended to support your own custom method. For example, to add a method called isAlmostOrigin() to the Point objects, write the following code :  &lt;source&gt; ...&quot;</title>
		<link rel="alternate" type="text/html" href="https://jsxgraph.org/wiki/index.php?title=Add_custom_methods_to_objects&amp;diff=6403&amp;oldid=prev"/>
		<updated>2015-06-25T19:39:25Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;JSXGraph objects can be extended to support your own custom method. For example, to add a method called isAlmostOrigin() to the Point objects, write the following code :  &amp;lt;source&amp;gt; ...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;JSXGraph objects can be extended to support your own custom method.&lt;br /&gt;
For example, to add a method called isAlmostOrigin() to the Point objects, write the following code :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source&amp;gt;&lt;br /&gt;
 JXG.extend(JXG.Point.prototype,  {&lt;br /&gt;
       isAlmostOrigin: function () {&lt;br /&gt;
     return Math.abs(this.X()) &amp;lt; 0.5 &amp;amp;&amp;amp; Math.abs(this.Y()) &amp;lt; 0.5&lt;br /&gt;
   }&lt;br /&gt;
 })&lt;br /&gt;
&lt;br /&gt;
 board = JXG.JSXGraph.initBoard(&amp;#039;box&amp;#039;, { axis:true })&lt;br /&gt;
 A = board.create(&amp;#039;point&amp;#039;, [1, 0], {name:&amp;#039;A&amp;#039;});&lt;br /&gt;
 alert(A.isAlmostOrigin()) // false&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nicolas.adenis.lamarre</name></author>
	</entry>
</feed>