Jump to content

One over the square root of an expression


Recommended Posts

I'm trying to write an article on my web site about special relativity.

Does HTML5 provide a way to render one over the square root of an expression on a web page?  The expression has superscripts and subscripts, which I know how to do.

Thank you for your help.

 

Jim Adrian

Link to post
Share on other sites

See if you can use this:

	<script>
	const recpSqrt = (value) => { return 1/(Math.sqrt(value)); }
	var v = 2; alert('Value: '+v+'\nSqrt: '+Math.sqrt(v)+'\nRecpSqrt: '+recpSqrt(v));
    v = 3; alert('Value: '+v+'\nSqrt: '+Math.sqrt(v)+'\nRecpSqrt: '+recpSqrt(v));
    v = 4; alert('Value: '+v+'\nSqrt: '+Math.sqrt(v)+'\nRecpSqrt: '+recpSqrt(v));
    v = 5; alert('Value: '+v+'\nSqrt: '+Math.sqrt(v)+'\nRecpSqrt: '+recpSqrt(v));
	</script>
	

 

Link to post
Share on other sites

Wikipedia and other sources use images to represent mathematical expressions on a page. HTML is not well equipped to represent them.

There is an XML-based language called MathML, but it is not well supported by browsers.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...