cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

Quick-add: + add another resource

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <h1>測地系変換</h1>
<p>
日本測地系の緯度経度と、世界測地系の緯度経度を変換
</p>
<div>
	<h2>日本測地系</h2>
緯度:<input type="text" id="ja_lat" value="35.697796" />, 経度:<input type="text" id="ja_lng" value="139.755464" />
</div>

<button id="convert_world" type="button">日本→世界</button>
<button id="convert_japan" type="button">世界→日本</button>
<div>
	<h2>世界測地系</h2>
	緯度:<input type="text" id="wo_lat" />, 経度:<input type="text" id="wo_lng" />
</div>
            
          
!
            
              var ja_lat = document.getElementById("ja_lat");
var ja_lng = document.getElementById("ja_lng");
var wo_lat = document.getElementById("wo_lat");
var wo_lng = document.getElementById("wo_lng");

var convert_world = function() {
	console.log('!');
	wo_lat.value = +ja_lat.value * 1.000106961 - +ja_lng.value * 0.000017467 - 0.004602017;
	wo_lng.value = +ja_lng.value * 1.000083049 + +ja_lat.value * 0.000046047 - 0.010041046;
};
var convert_japan = function() {
	console.log('!');
	ja_lat.value = +wo_lat.value - +wo_lat.value * 0.00010695 + +wo_lng.value * 0.000017464 + 0.0046017;
	ja_lng.value = +wo_lng.value - +wo_lat.value * 0.000046038 - +wo_lng.value * 0.000083043 + 0.010040;
};

document.getElementById("convert_world").addEventListener('click', convert_world, false);
document.getElementById("convert_japan").addEventListener('click', convert_japan, false);

            
          
!
999px
Loading ..................

Console