File: polygon2.html

package info (click to toggle)
jsxgraph 1.10.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 24,804 kB
  • sloc: javascript: 82,299; xml: 5,869; java: 1,072; php: 281; makefile: 184; python: 174; cpp: 76; sh: 12
file content (40 lines) | stat: -rw-r--r-- 1,416 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<html>
<head>
   <title>JSXGraph example</title>
   <link rel="stylesheet" type="text/css" href="../distrib/jsxgraph.css" />
<script type="text/javascript" src="jquery-3.5.1.min.js"></script>
<!--<script type="text/javascript" src="/javascript/prototype/prototype.js"></script>-->
<script type="text/javascript" src="../distrib/jsxgraphcore.js"></script>
</head>
<body>
<h1 onclick="brd.clearTraces();">Polygon</h1>
<form><input type="text"></form>
<!-- Drawing area -->
<div id="box" class="jxgbox" style="width:600px; height:600px; overflow:hidden; /*position:absolute; top:0px; left:0px;*/"></div>
<!-- Drawing area -->
<div id="debug" style="display:block;"></div>

<script type="text/javascript">
/* <![CDATA[ */
var brd = JXG.JSXGraph.initBoard('box', {originX: 300, originY: 300, grid:true, unitX: 15, unitY: 15, axis:true});
var A = brd.create('point', [-3,5], {name:'A', withLabel:true, visible:true});
var B = brd.create('point', [8,8], {name:'B', withLabel:true, visible:true});
var C = brd.create('point', [-4,-3], {name:'C', withLabel:true, visible:true});

var p2 = brd.create('polygon', [A,B,C],
    {borders:{
        visible:true,
        withLabel:true,
        label:{position:'top'}},
     vertices:{visible:false, size:2},
     withLabel:false,
     hasInnerPoints:true,
     fillColor:'yellow',
     highlightFillColor:'blue',
     scalable: false
     });

/* ]]> */
</script>
</body>
</html>