Group Abstract Group Abstract

Message Boards Message Boards

0
|
2.9K Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Unexpected results from N[ ]?

Posted 4 years ago

In my first foray into the Wolfram Language, I got good results up until some point. After that, I could not get N[] to produce the same numerical results it yielded before.

The expression is

N[RegionIntersection[InfiniteLine[{{15,158},{73.6777...
,200.6777...}}],InfiniteLine[{{0,193},{300,193}}]],5]

What I'm expecting back is a point in approximate numeric form, but instead I get my expression back, just without the N[], i.e.:

RegionIntersection[InfiniteLine[{{15.000,158.00},{73.6777...,200.678...}}],InfiniteLine[{{0,193.00},{300.00,193.00}}]]

My question now is how did I manage to mess that up?

2 Replies

Are those dots meant to indicate a repeating, periodic digit? Then the standard syntax is more complicated and uses FromDigits:

RegionIntersection[
 InfiniteLine[{{15, 158},
   {FromDigits[{{73, 6, {7}}, 1}],
    FromDigits[{{200, 6, {7}}, 1}]}}],
 InfiniteLine[{{0, 193}, {300, 193}}]]
N[%, 5]
POSTED BY: Gianluca Gorni
Posted 4 years ago

Hi Martin,

Hard to say without looking at the complete expression. What exactly is the "..."? This works fine, so something is wrong in the "...".

RegionIntersection[
 InfiniteLine[{{15.000, 158.00}, {73.6777, 200.678}}], 
 InfiniteLine[{{0, 193.00}, {300.00, 193.00}}]]
(* Point[{63.1213, 193.}] *)
POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard